Added the rc-abort command, #175106 thanks to Daniel Drake.

This commit is contained in:
Roy Marples
2007-04-20 13:12:21 +00:00
parent a316a1fa72
commit c52f216450
7 changed files with 128 additions and 117 deletions

View File

@ -469,22 +469,22 @@ static pid_t _exec_service (const char *service, const char *arg)
return (-1);
}
if ((pid = fork ()) == 0) {
char *myarg = rc_xstrdup (arg);
if ((pid = vfork ()) == 0) {
int e = 0;
execl (file, file, myarg, (char *) NULL);
execl (file, file, arg, (char *) NULL);
e = errno;
free (myarg);
unlink (fifo);
free (fifo);
eerrorx ("unable to exec `%s': %s", file, strerror (errno));
eerror ("unable to exec `%s': %s", file, strerror (errno));
free (file);
_exit (EXIT_FAILURE);
}
free (fifo);
free (file);
if (pid == -1) {
eerror ("unable to fork: %s", strerror (errno));
eerror ("vfork: %s", strerror (errno));
return (pid);
}