From 169c465a83ef690c2f84ef563c5b56062ee2cb13 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 12 Jan 2005 22:40:46 +0000 Subject: Reorganize header file inclusion throughout so that cygerrno.h comes first. * fhandler.h (select_record::thread_errno): Save any encountered errno here. (select_record::set_select_errno): New function. (select_record::saw_error): New function. (select_record::select_record): Initialize thread_errno to zero. * select.cc (set_handle_or_return_if_not_open): Set thread_errno on failure. (select_stuff::wait): Record errno for later resurrection in calling thread. (peek_serial): Ditto. --- winsup/cygwin/fhandler.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index df02ece23..47b216cda 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -1216,7 +1216,7 @@ struct select_record int fd; HANDLE h; fhandler_base *fh; - bool saw_error; + int thread_errno; bool windows_handle; bool read_ready, write_ready, except_ready; bool read_selected, write_selected, except_selected; @@ -1227,9 +1227,11 @@ struct select_record fd_set *exceptfds); void (*cleanup) (select_record *me, class select_stuff *stuff); struct select_record *next; + void set_select_errno () {__seterrno (); thread_errno = errno;} + int saw_error () {return thread_errno;} select_record (fhandler_base *in_fh = NULL) : fd (0), h (NULL), - fh (in_fh), saw_error (false), windows_handle (false), + fh (in_fh), thread_errno (0), windows_handle (false), read_ready (false), write_ready (false), except_ready (false), read_selected (false), write_selected (false), except_selected (false), except_on_write (false), -- cgit v1.2.3