This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Build under GLIBC 2.8


As I said recently on gdb-patches, Ubuntu Intrepid Ibex adds the
warn_unused_result attribute to many functions.  This patch, along
with those I posted there, allows archer to build on such systems.
From 528ea76f14ff154f0d869c5d6bd4a60085d747a8 Mon Sep 17 00:00:00 2001
From: Jim Blandy <jimb@red-bean.com>
Date: Fri, 12 Dec 2008 18:06:59 -0800
Subject: [PATCH] gdb
 	Check return values of functions declared with warn_unused_result
 	attribute in GLIBC 2.8.
 	* python/python.c (gdbpy_post_event): Check return value from write.

---
 gdb/ChangeLog       |    4 ++++
 gdb/python/python.c |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 93ec67b..0975415 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -2,6 +2,10 @@
 
 	Check return values of functions declared with warn_unused_result
 	attribute in GLIBC 2.8.
+	* python/python.c (gdbpy_post_event): Check return value from write.
+
+	Check return values of functions declared with warn_unused_result
+	attribute in GLIBC 2.8.
 	* cli/cli-cmds.c (pwd_command): Check return value from getcwd.
 	* inflow.c (check_syscall): New function.
 	(new_tty): Use check_syscall to check return values from open and dup.
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 1432e5e..fd5cded 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -505,7 +505,8 @@ gdbpy_post_event (PyObject *self, PyObject *args)
   if (wakeup)
     {
       char c = 'q';		/* Anything. */
-      write (gdbpy_event_fds[1], &c, 1);
+      if (write (gdbpy_event_fds[1], &c, 1) != 1)
+        return PyErr_SetFromErrno (PyExc_IOError);
     }
 
   Py_RETURN_NONE;
-- 
1.5.6.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]