changeset 4156:d39ac5712d2e HEAD

Make sure errno is restored when exiting SIGRT signal handler.
author Timo Sirainen <tss@iki.fi>
date Sun, 09 Apr 2006 22:37:29 +0300
parents cf02b2fbcb7a
children ed7d77a89b17
files src/lib/ioloop-notify-dn.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-notify-dn.c	Sun Apr 09 20:29:10 2006 +0300
+++ b/src/lib/ioloop-notify-dn.c	Sun Apr 09 22:37:29 2006 +0300
@@ -29,6 +29,7 @@
 {
 	struct ioloop_notify_handler_context *ctx =
 		current_ioloop->notify_handler_context;
+	int saved_errno = errno;
 	int ret;
 
 	ret = write(ctx->event_pipe[1], &si->si_fd, sizeof(int));
@@ -36,6 +37,8 @@
 		i_fatal("write(event_pipe) failed: %m");
 
 	i_assert(ret <= 0 || ret == sizeof(int));
+
+	errno = saved_errno;
 }
 
 static void event_callback(void *context)