summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/selfpipe_internal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstddjb/selfpipe_internal.c b/src/libstddjb/selfpipe_internal.c
index 34bdd51..45063bc 100644
--- a/src/libstddjb/selfpipe_internal.c
+++ b/src/libstddjb/selfpipe_internal.c
@@ -16,6 +16,7 @@ int selfpipe_fd = -1 ;
#else
#include <unistd.h>
+#include <errno.h>
#include <skalibs/allreadwrite.h>
@@ -23,8 +24,10 @@ int selfpipe[2] = { -1, -1 } ;
void selfpipe_tophalf (int s)
{
+ int e = errno ;
unsigned char c = (unsigned char)s ;
write(selfpipe[1], (char *)&c, 1) ;
+ errno = e ;
}
#endif