The following commit has been merged in the master branch:
commit dabcb9560063a134a01c4223b1d6fa3624175daa
Author: Guillem Jover <[email protected]>
Date: Sun Jan 20 02:33:13 2013 +0100
dselect: Save and restore errno on signal handler
This makes sure that the signal function will not stomp over an errno
value already set when interrupted.
The signal handler is still not async-safe, but this at least fixes one
of the problems.
diff --git a/dselect/baselist.cc b/dselect/baselist.cc
index ee49696..1ee0c90 100644
--- a/dselect/baselist.cc
+++ b/dselect/baselist.cc
@@ -4,6 +4,7 @@
*
* Copyright © 1994,1995 Ian Jackson <[email protected]>
* Copyright © 2001 Wichert Akkerman <[email protected]>
+ * Copyright © 2007-2013 Guillem Jover <[email protected]>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +27,7 @@
#include <sys/termios.h>
#include <assert.h>
+#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
@@ -49,6 +51,7 @@ void mywerase(WINDOW *win) {
baselist *baselist::signallist= 0;
void baselist::sigwinchhandler(int) {
+ int save_errno = errno;
struct winsize size;
debug(dbg_general, "baselist::sigwinchhandler(), signallist=%p", signallist);
baselist *p= signallist;
@@ -58,6 +61,7 @@ void baselist::sigwinchhandler(int) {
resizeterm(size.ws_row, size.ws_col); wrefresh(curscr);
p->startdisplay();
if (doupdate() == ERR) ohshite(_("doupdate in SIGWINCH handler failed"));
+ errno = save_errno;
}
static void cu_sigwinch(int, void **argv) {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]