[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 48/87: Make settrans return value returned by chroot command
From: |
Samuel Thibault |
Subject: |
[hurd] 48/87: Make settrans return value returned by chroot command |
Date: |
Sun, 09 Nov 2014 11:05:03 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit d324631edd3c2549a8cda05c2fc56ceea7fe0593
Author: Svante Signell <address@hidden>
Date: Tue Aug 19 19:52:01 2014 +0200
Make settrans return value returned by chroot command
* utils/settrans.c (main): In case of chroot_command, get status from
waitpid()
call, and call error() appropriately.
---
utils/settrans.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/utils/settrans.c b/utils/settrans.c
index 84b271a..cd40c56 100644
--- a/utils/settrans.c
+++ b/utils/settrans.c
@@ -310,8 +310,9 @@ main(int argc, char *argv[])
if (chroot_command)
{
- pid_t pid;
- switch ((pid = fork ()))
+ pid_t child;
+ int status;
+ switch ((child = fork ()))
{
case -1:
error (6, errno, "fork");
@@ -348,12 +349,19 @@ main(int argc, char *argv[])
break;
default: /* Parent. */
- if (waitpid (pid, NULL, 0) == -1)
- error (8, errno, "waitpid");
+ if (waitpid (child, &status, 0) != child)
+ error (8, errno, "waitpid on %d", child);
err = fsys_goaway (active_control, goaway_flags);
if (err && err != EBUSY)
error (9, err, "fsys_goaway");
+
+ if (WIFSIGNALED (status))
+ error (WTERMSIG (status) + 128, 0,
+ "%s for child %d", strsignal (WTERMSIG (status)), child);
+ if (WEXITSTATUS (status) != 0)
+ error (WEXITSTATUS (status), 0,
+ "Error %d for child %d", WEXITSTATUS (status), child);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 31/87: Merge branch 'merge-random', (continued)
- [hurd] 31/87: Merge branch 'merge-random', Samuel Thibault, 2014/11/09
- [hurd] 41/87: libdiskfs: expose the ST_NOATIME flag, Samuel Thibault, 2014/11/09
- [hurd] 43/87: ext2fs: use correct type for block numbers, Samuel Thibault, 2014/11/09
- [hurd] 42/87: libdiskfs: fix deadlock, Samuel Thibault, 2014/11/09
- [hurd] 44/87: libpipe: fix calls to pipe_send with no data, Samuel Thibault, 2014/11/09
- [hurd] 24/87: ext2fs: fix type of retry_dotdot, Samuel Thibault, 2014/11/09
- [hurd] 23/87: ext2fs: fix type of blockaddr, Samuel Thibault, 2014/11/09
- [hurd] 30/87: utils/settrans: implement settrans --start, Samuel Thibault, 2014/11/09
- [hurd] 25/87: Prepare the random translator to be merged into the Hurd sources, Samuel Thibault, 2014/11/09
- [hurd] 46/87: libpipe: fix spurious calls to pipe_send, Samuel Thibault, 2014/11/09
- [hurd] 48/87: Make settrans return value returned by chroot command,
Samuel Thibault <=
- [hurd] 51/87: Fix ifsock permission check, Samuel Thibault, 2014/11/09
- [hurd] 55/87: libihash: fix comparison between signed and unsigned integer, Samuel Thibault, 2014/11/09
- [hurd] 54/87: trans/mtab: use setnullauth to drop privileges, Samuel Thibault, 2014/11/09
- [hurd] 21/87: ext2fs: fix compiler warning, Samuel Thibault, 2014/11/09
- [hurd] 49/87: Add missing linefeed, Samuel Thibault, 2014/11/09
- [hurd] 58/87: libdiskfs: fix /servers/exec lookup, Samuel Thibault, 2014/11/09
- [hurd] 59/87: hurd: make memory_object parameter polymorphic, Samuel Thibault, 2014/11/09
- [hurd] 61/87: procfs: fix typo in comment, Samuel Thibault, 2014/11/09
- [hurd] 53/87: libtrivfs: fix typo, Samuel Thibault, 2014/11/09
- [hurd] 64/87: BSD apps want sin_zero cleared in sys_getname., Samuel Thibault, 2014/11/09