Blame support/xposix_spawn.c

Packit Bot 40fc07
/* xposix_spawn implementation.
Packit Bot 40fc07
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Bot 40fc07
   This file is part of the GNU C Library.
Packit Bot 40fc07
Packit Bot 40fc07
   The GNU C Library is free software; you can redistribute it and/or
Packit Bot 40fc07
   modify it under the terms of the GNU Lesser General Public
Packit Bot 40fc07
   License as published by the Free Software Foundation; either
Packit Bot 40fc07
   version 2.1 of the License, or (at your option) any later version.
Packit Bot 40fc07
Packit Bot 40fc07
   The GNU C Library is distributed in the hope that it will be useful,
Packit Bot 40fc07
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Bot 40fc07
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Bot 40fc07
   Lesser General Public License for more details.
Packit Bot 40fc07
Packit Bot 40fc07
   You should have received a copy of the GNU Lesser General Public
Packit Bot 40fc07
   License along with the GNU C Library; if not, see
Packit Bot 40fc07
   <http://www.gnu.org/licenses/>.  */
Packit Bot 40fc07
Packit Bot 40fc07
#include <support/xspawn.h>
Packit Bot 40fc07
#include <support/check.h>
Packit Bot 40fc07
Packit Bot 40fc07
pid_t
Packit Bot 40fc07
xposix_spawn (const char *file, const posix_spawn_file_actions_t *fa,
Packit Bot 40fc07
             const posix_spawnattr_t *attr, char *const args[],
Packit Bot 40fc07
             char *const envp[])
Packit Bot 40fc07
{
Packit Bot 40fc07
  pid_t pid;
Packit Bot 40fc07
  int status = posix_spawn (&pid, file, fa, attr, args, envp);
Packit Bot 40fc07
  if (status != 0)
Packit Bot 40fc07
    FAIL_EXIT1 ("posix_spawn to %s file failed: %m", file);
Packit Bot 40fc07
  return pid;
Packit Bot 40fc07
}