[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 05/75: random: improve error handling
From: |
Samuel Thibault |
Subject: |
[hurd] 05/75: random: improve error handling |
Date: |
Thu, 14 Jan 2016 01:04:01 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch dde
in repository hurd.
commit 5f7601f47a3fd8957a52c03f1135534fc2232539
Author: Justus Winter <address@hidden>
Date: Fri Nov 6 12:00:31 2015 +0100
random: improve error handling
* random/random.c (arrange_shutdown_notification): Improve error
handling.
(main): Display warning if arranging the shutdown notification failed.
---
random/random.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/random/random.c b/random/random.c
index 9ade161..f483a5d 100644
--- a/random/random.c
+++ b/random/random.c
@@ -552,7 +552,7 @@ sigterm_handler (int signo)
raise (SIGTERM);
}
-void
+static error_t
arrange_shutdown_notification ()
{
error_t err;
@@ -570,24 +570,26 @@ arrange_shutdown_notification ()
err = ports_create_port (shutdown_notify_class, fsys->pi.bucket,
sizeof (struct port_info), &pi);
if (err)
- return;
+ return err;
procserver = getproc ();
- if (!procserver)
- return;
+ if (! MACH_PORT_VALID (procserver))
+ return EMIG_SERVER_DIED;
err = proc_getmsgport (procserver, 1, &initport);
mach_port_deallocate (mach_task_self (), procserver);
if (err)
- return;
+ return err;
notify = ports_get_send_right (pi);
ports_port_deref (pi);
- startup_request_notification (initport, notify,
- MACH_MSG_TYPE_MAKE_SEND,
- program_invocation_short_name);
+ err = startup_request_notification (initport, notify,
+ MACH_MSG_TYPE_MAKE_SEND,
+ program_invocation_short_name);
+
mach_port_deallocate (mach_task_self (), notify);
mach_port_deallocate (mach_task_self (), initport);
+ return err;
}
@@ -621,7 +623,9 @@ main (int argc, char **argv)
if (err)
error (3, err, "trivfs_startup");
- arrange_shutdown_notification ();
+ err = arrange_shutdown_notification ();
+ if (err)
+ error (0, err, "Cannot request shutdown notification");
/* Launch. */
ports_manage_port_operations_multithread (fsys->pi.bucket, random_demuxer,
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 11/75: Make dde conditionally built under presence of libpciaccess, (continued)
- [hurd] 11/75: Make dde conditionally built under presence of libpciaccess, Samuel Thibault, 2016/01/13
- [hurd] 13/75: Clean debugging macro, Samuel Thibault, 2016/01/13
- [hurd] 09/75: libihash: optimize lookup-or-insert operations, Samuel Thibault, 2016/01/13
- [hurd] 03/75: Remove unused variables, Samuel Thibault, 2016/01/13
- [hurd] 17/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 19/75: Add devnode documentation, Samuel Thibault, 2016/01/13
- [hurd] 23/75: Add missing menus, Samuel Thibault, 2016/01/13
- [hurd] 20/75: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd into dde, Samuel Thibault, 2016/01/13
- [hurd] 12/75: Merge branch 'dde' of ssh://git.savannah.gnu.org/srv/git/hurd/incubator into dde, Samuel Thibault, 2016/01/13
- [hurd] 02/75: libtrivfs: remove deprecated static class vectors, Samuel Thibault, 2016/01/13
- [hurd] 05/75: random: improve error handling,
Samuel Thibault <=
- [hurd] 01/75: pfinet: fix sanity check at translator startup time, Samuel Thibault, 2016/01/13
- [hurd] 22/75: Fix undefined reference, Samuel Thibault, 2016/01/13
- [hurd] 24/75: Use -L instead of -Wl,-rpath-link, Samuel Thibault, 2016/01/13
- [hurd] 26/75: libihash: fix fast insertion corner case, Samuel Thibault, 2016/01/13
- [hurd] 25/75: libihash: fix ill-devised locp lookup interface, Samuel Thibault, 2016/01/13
- [hurd] 21/75: Drop spurious debugging or outdated changes, Samuel Thibault, 2016/01/13
- [hurd] 14/75: Add devnode translator, Samuel Thibault, 2016/01/13
- [hurd] 30/75: ext2fs: improve the block cache, Samuel Thibault, 2016/01/13
- [hurd] 28/75: libihash: fix item insertion, Samuel Thibault, 2016/01/13
- [hurd] 66/75: Make private variables static, Samuel Thibault, 2016/01/13