summaryrefslogtreecommitdiff
path: root/libguile/scmsigs.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-11-30 18:43:41 +0100
committerLudovic Courtès <ludo@gnu.org>2008-11-30 18:43:41 +0100
commit634aa8de8f8facc285867100c6c0a54c4ea5e6d4 (patch)
tree589bacf6d22ddfe901c5c746220948e0c3e6d04b /libguile/scmsigs.c
parent9b36a80c79c6c26e8e3016eb5d88ea86f66de368 (diff)
downloadguile-634aa8de8f8facc285867100c6c0a54c4ea5e6d4.tar.gz
Check the return value of libc's functions to make `_FORTIFY_SOURCE=2' work.
This fixes bug #24009 reported by Martin Pitt. * libguile/threads.c (guilify_self_1): Check the return value of pipe(2). (scm_std_select): Use `full_read ()' instead of `read ()' when reading from WAKEUP_FD. * libguile/async.c (scm_i_queue_async_cell): Use `full_write ()' instead of write(2) when writing to SLEEP_FD. * libguile/fports.c (fport_flush): Likewise. * libguile/posix.c (getgroups): Use the return value of getgroups(2) as NGROUPS. (scm_nice): Get the return value of nice(2) to make glibc happy. * libguile/scmsigs.c (take_signal): Use `full_write ()' instead of write(2).
Diffstat (limited to 'libguile/scmsigs.c')
-rw-r--r--libguile/scmsigs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 237bc5323..eb7cec67b 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -63,6 +63,9 @@
#define pipe(fd) _pipe (fd, 256, O_BINARY)
#endif
+#include <full-write.h>
+
+
/* SIGRETTYPE is the type that signal handlers return. See <signal.h> */
@@ -137,7 +140,7 @@ static SIGRETTYPE
take_signal (int signum)
{
char sigbyte = signum;
- write (signal_pipe[1], &sigbyte, 1);
+ full_write (signal_pipe[1], &sigbyte, 1);
#ifndef HAVE_SIGACTION
signal (signum, take_signal);