Blame src/ostree/ot-builtin-trivial-httpd.c

rpm-build 0fba15
/*
rpm-build 0fba15
 * Copyright (C) 2016 Colin Walters <walters@verbum.org>
rpm-build 0fba15
 *
rpm-build 0fba15
 * SPDX-License-Identifier: LGPL-2.0+
rpm-build 0fba15
 *
rpm-build 0fba15
 * This library is free software; you can redistribute it and/or
rpm-build 0fba15
 * modify it under the terms of the GNU Lesser General Public
rpm-build 0fba15
 * License as published by the Free Software Foundation; either
rpm-build 0fba15
 * version 2 of the License, or (at your option) any later version.
rpm-build 0fba15
 *
rpm-build 0fba15
 * This library is distributed in the hope that it will be useful,
rpm-build 0fba15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build 0fba15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rpm-build 0fba15
 * Lesser General Public License for more details.
rpm-build 0fba15
 *
rpm-build 0fba15
 * You should have received a copy of the GNU Lesser General Public
rpm-build 0fba15
 * License along with this library; if not, write to the
rpm-build 0fba15
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rpm-build 0fba15
 * Boston, MA 02111-1307, USA.
rpm-build 0fba15
 */
rpm-build 0fba15
rpm-build 0fba15
#include "config.h"
rpm-build 0fba15
rpm-build 0fba15
#include "ot-main.h"
rpm-build 0fba15
#include "ot-builtins.h"
rpm-build 0fba15
#include "ostree.h"
rpm-build 0fba15
#include "otutil.h"
rpm-build 0fba15
rpm-build 0fba15
gboolean
rpm-build 0fba15
ostree_builtin_trivial_httpd (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
rpm-build 0fba15
{
rpm-build 0fba15
  g_autoptr(GPtrArray) new_argv = g_ptr_array_new ();
rpm-build 0fba15
rpm-build 0fba15
  g_ptr_array_add (new_argv, PKGLIBEXECDIR "/ostree-trivial-httpd");
rpm-build 0fba15
  for (int i = 1; i < argc; i++)
rpm-build 0fba15
    g_ptr_array_add (new_argv, argv[i]);
rpm-build 0fba15
  g_ptr_array_add (new_argv, NULL);
rpm-build 0fba15
  execvp (new_argv->pdata[0], (char**)new_argv->pdata);
rpm-build 0fba15
  /* Fall through on error */
rpm-build 0fba15
  glnx_set_error_from_errno (error);
rpm-build 0fba15
  return FALSE;
rpm-build 0fba15
}