From: Chris Hanson Date: Wed, 22 Jan 2003 18:42:32 +0000 (+0000) Subject: Pay attention to POLLERR and POLLHUP values returned by poll(). X-Git-Tag: 20090517-FFI~2058 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1b5608282e6c99a8cc0bd83a99614ba424e111c7;p=mit-scheme.git Pay attention to POLLERR and POLLHUP values returned by poll(). --- diff --git a/v7/src/microcode/osio.h b/v7/src/microcode/osio.h index ce70c2e4c..79e173bf5 100644 --- a/v7/src/microcode/osio.h +++ b/v7/src/microcode/osio.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: osio.h,v 1.17 2003/01/22 02:03:59 cph Exp $ +$Id: osio.h,v 1.18 2003/01/22 18:42:20 cph Exp $ Copyright 1990,1991,1993,1994,1995,1997 Massachusetts Institute of Technology Copyright 2000,2003 Massachusetts Institute of Technology @@ -85,6 +85,8 @@ extern CONST int OS_have_select_p; typedef PTR select_registry_t; #define SELECT_MODE_READ 1 #define SELECT_MODE_WRITE 2 +#define SELECT_MODE_ERROR 4 +#define SELECT_MODE_HUP 8 #define SELECT_INTERRUPT (-1) #define SELECT_PROCESS_STATUS_CHANGE (-2) diff --git a/v7/src/microcode/prosio.c b/v7/src/microcode/prosio.c index 646aebec0..4f36a73d6 100644 --- a/v7/src/microcode/prosio.c +++ b/v7/src/microcode/prosio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prosio.c,v 1.20 2003/01/22 02:04:06 cph Exp $ +$Id: prosio.c,v 1.21 2003/01/22 18:42:26 cph Exp $ Copyright 1987,1990,1991,1992,1993,1994 Massachusetts Institute of Technology Copyright 1996,1997,2001,2003 Massachusetts Institute of Technology @@ -327,7 +327,9 @@ DEFINE_PRIMITIVE ("TEST-SELECT-REGISTRY", Prim_test_selreg, 4, 4, 0) if (mode > 0) { SCHEME_OBJECT sfd = (long_to_integer (fd)); - if ((mode & SELECT_MODE_READ) != 0) + if (((mode & SELECT_MODE_READ) != 0) + || ((mode & SELECT_MODE_ERROR) != 0) + || ((mode & SELECT_MODE_HUP) != 0)) { VECTOR_SET (vr, ir, sfd); ir += 1; diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index 848579777..1590fc33c 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxio.c,v 1.48 2003/01/22 02:04:13 cph Exp $ +$Id: uxio.c,v 1.49 2003/01/22 18:42:32 cph Exp $ Copyright 1990,1991,1992,1993,1994,1995 Massachusetts Institute of Technology Copyright 1996,1997,1998,2000,2001,2003 Massachusetts Institute of Technology @@ -374,7 +374,9 @@ struct select_registry_s #define ENCODE_MODE(revents) \ (((((revents) & POLLIN) != 0) ? SELECT_MODE_READ : 0) \ - | ((((revents) & POLLOUT) != 0) ? SELECT_MODE_WRITE : 0)) + | ((((revents) & POLLOUT) != 0) ? SELECT_MODE_WRITE : 0) \ + | ((((revents) & POLLERR) != 0) ? SELECT_MODE_ERROR : 0) \ + | ((((revents) & POLLHUP) != 0) ? SELECT_MODE_HUP : 0)) select_registry_t DEFUN_VOID (OS_allocate_select_registry)