From 634aa8de8f8facc285867100c6c0a54c4ea5e6d4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 30 Nov 2008 18:43:41 +0100 Subject: 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). --- libguile/async.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libguile/async.c') diff --git a/libguile/async.c b/libguile/async.c index 87d330d60..bf03c48bd 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2002, 2004, 2006, 2008 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,6 +41,8 @@ #include #endif +#include + /* {Asynchronous Events} * @@ -241,13 +243,13 @@ scm_i_queue_async_cell (SCM c, scm_i_thread *t) if (sleep_fd >= 0) { char dummy = 0; + /* Likewise, T might already been done with sleeping here, but interrupting it once too often does no harm. T might also not yet have started sleeping, but this is no problem either since the data written to a pipe will not be lost, unlike a - condition variable signal. - */ - write (sleep_fd, &dummy, 1); + condition variable signal. */ + full_write (sleep_fd, &dummy, 1); } /* This is needed to protect sleep_mutex. -- cgit v1.2.3