Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 545ceceb6..48cb56c96 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -34,8 +34,8 @@ details. */
#include "select.h"
#include "cygerrno.h"
#include "security.h"
-#include "fhandler.h"
#include "path.h"
+#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
#include "sigproc.h"
@@ -335,7 +335,7 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
if (me->write_selected && me->write_ready)
{
UNIX_FD_SET (me->fd, writefds);
- if (me->except_on_write && me->fh->get_device () == FH_SOCKET)
+ if (me->except_on_write && me->fh->is_socket ())
((fhandler_socket *) me->fh)->set_connect_state (CONNECTED);
ready++;
}
@@ -344,7 +344,7 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
if (me->except_on_write) /* Only on sockets */
{
UNIX_FD_SET (me->fd, writefds);
- if (me->fh->get_device () == FH_SOCKET)
+ if (me->fh->is_socket ())
((fhandler_socket *) me->fh)->set_connect_state (CONNECTED);
}
if (me->except_selected)
@@ -553,9 +553,9 @@ out:
static int
start_thread_pipe (select_record *me, select_stuff *stuff)
{
- if (stuff->device_specific[FHDEVN (FH_PIPE)])
+ if (stuff->device_specific_pipe)
{
- me->h = *((pipeinf *) stuff->device_specific[FHDEVN (FH_PIPE)])->thread;
+ me->h = *((pipeinf *) stuff->device_specific_pipe)->thread;
return 1;
}
pipeinf *pi = new pipeinf;
@@ -565,20 +565,20 @@ start_thread_pipe (select_record *me, select_stuff *stuff)
me->h = *pi->thread;
if (!me->h)
return 0;
- stuff->device_specific[FHDEVN (FH_PIPE)] = (void *) pi;
+ stuff->device_specific_pipe = (void *) pi;
return 1;
}
static void
pipe_cleanup (select_record *, select_stuff *stuff)
{
- pipeinf *pi = (pipeinf *) stuff->device_specific[FHDEVN (FH_PIPE)];
+ pipeinf *pi = (pipeinf *) stuff->device_specific_pipe;
if (pi && pi->thread)
{
pi->stop_thread_pipe = true;
pi->thread->detach ();
delete pi;
- stuff->device_specific[FHDEVN (FH_PIPE)] = NULL;
+ stuff->device_specific_pipe = NULL;
}
}
@@ -984,9 +984,9 @@ thread_serial (void *arg)
static int
start_thread_serial (select_record *me, select_stuff *stuff)
{
- if (stuff->device_specific[FHDEVN (FH_SERIAL)])
+ if (stuff->device_specific_serial)
{
- me->h = *((serialinf *) stuff->device_specific[FHDEVN (FH_SERIAL)])->thread;
+ me->h = *((serialinf *) stuff->device_specific_serial)->thread;
return 1;
}
serialinf *si = new serialinf;
@@ -994,20 +994,20 @@ start_thread_serial (select_record *me, select_stuff *stuff)
si->stop_thread_serial = FALSE;
si->thread = new cygthread (thread_serial, (LPVOID) si, "select_serial");
me->h = *si->thread;
- stuff->device_specific[FHDEVN (FH_SERIAL)] = (void *) si;
+ stuff->device_specific_serial = (void *) si;
return 1;
}
static void
serial_cleanup (select_record *, select_stuff *stuff)
{
- serialinf *si = (serialinf *) stuff->device_specific[FHDEVN (FH_SERIAL)];
+ serialinf *si = (serialinf *) stuff->device_specific_serial;
if (si && si->thread)
{
si->stop_thread_serial = true;
si->thread->detach ();
delete si;
- stuff->device_specific[FHDEVN (FH_SERIAL)] = NULL;
+ stuff->device_specific_serial = NULL;
}
}
@@ -1255,7 +1255,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
{
socketinf *si;
- if ((si = (socketinf *) stuff->device_specific[FHDEVN (FH_SOCKET)]))
+ if ((si = (socketinf *) stuff->device_specific_socket))
{
me->h = *si->thread;
return 1;
@@ -1323,7 +1323,7 @@ start_thread_socket (select_record *me, select_stuff *stuff)
select_printf ("exitsock %p", si->exitsock);
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->readfds);
WINSOCK_FD_SET ((HANDLE) si->exitsock, &si->exceptfds);
- stuff->device_specific[FHDEVN (FH_SOCKET)] = (void *) si;
+ stuff->device_specific_socket = (void *) si;
si->start = &stuff->start;
select_printf ("stuff_start %p", &stuff->start);
si->thread = new cygthread (thread_socket, (LPVOID) si, "select_socket");
@@ -1339,7 +1339,7 @@ err:
void
socket_cleanup (select_record *, select_stuff *stuff)
{
- socketinf *si = (socketinf *) stuff->device_specific[FHDEVN (FH_SOCKET)];
+ socketinf *si = (socketinf *) stuff->device_specific_socket;
select_printf ("si %p si->thread %p", si, si ? si->thread : NULL);
if (si && si->thread)
{
@@ -1367,7 +1367,7 @@ socket_cleanup (select_record *, select_stuff *stuff)
si->thread->detach ();
shutdown (si->exitsock, SD_BOTH);
closesocket (si->exitsock);
- stuff->device_specific[FHDEVN (FH_SOCKET)] = NULL;
+ stuff->device_specific_socket = NULL;
delete si;
}
select_printf ("returning");