From 00e378f17c39c52689601bc622b9cd78a0cdce12 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 20 Sep 2009 23:29:34 +0200 Subject: s3:lib/select: don't overwrite errno in the signal handler metze --- source3/lib/select.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } /******************************************************************* -- cgit