summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-09-20 23:29:34 +0200
committerStefan Metzmacher <metze@samba.org>2009-09-21 05:55:05 +0200
commit00e378f17c39c52689601bc622b9cd78a0cdce12 (patch)
treead89c55579e8abba6e4a93ba38ffc7289a5903b1
parentd13dfbeb6c6ab5b20277439da5b95f1a7f2850eb (diff)
downloadsamba-00e378f17c39c52689601bc622b9cd78a0cdce12.tar.gz
samba-00e378f17c39c52689601bc622b9cd78a0cdce12.tar.bz2
samba-00e378f17c39c52689601bc622b9cd78a0cdce12.zip
s3:lib/select: don't overwrite errno in the signal handler
metze
-rw-r--r--source3/lib/select.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/select.c b/source3/lib/select.c
index a58530af8d..b5443ff20c 100644
--- a/source3/lib/select.c
+++ b/source3/lib/select.c
@@ -39,11 +39,15 @@ static volatile unsigned pipe_written, pipe_read;
void sys_select_signal(char c)
{
+ int saved_errno = errno;
+
if (!initialised) return;
if (pipe_written > pipe_read+256) return;
if (write(select_pipe[1], &c, 1) == 1) pipe_written++;
+
+ errno = saved_errno;
}
/*******************************************************************