os: Move ETEST macro from io.c to osdep.h
This lets other code share this functionality Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
0d294462a5
commit
ef7ddbe242
14
os/io.c
14
os/io.c
|
@ -102,20 +102,6 @@ typedef struct _connectionOutput {
|
||||||
static ConnectionInputPtr AllocateInputBuffer(void);
|
static ConnectionInputPtr AllocateInputBuffer(void);
|
||||||
static ConnectionOutputPtr AllocateOutputBuffer(void);
|
static ConnectionOutputPtr AllocateOutputBuffer(void);
|
||||||
|
|
||||||
/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno
|
|
||||||
* for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
|
|
||||||
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
|
|
||||||
*/
|
|
||||||
#ifndef WIN32
|
|
||||||
# if (EAGAIN != EWOULDBLOCK)
|
|
||||||
# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
|
|
||||||
# else
|
|
||||||
# define ETEST(err) (err == EAGAIN)
|
|
||||||
# endif
|
|
||||||
#else /* WIN32 The socket errorcodes differ from the normal errors */
|
|
||||||
#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Bool CriticalOutputPending;
|
static Bool CriticalOutputPending;
|
||||||
static int timesThisConnection = 0;
|
static int timesThisConnection = 0;
|
||||||
static ConnectionInputPtr FreeInputs = (ConnectionInputPtr) NULL;
|
static ConnectionInputPtr FreeInputs = (ConnectionInputPtr) NULL;
|
||||||
|
|
14
os/osdep.h
14
os/osdep.h
|
@ -100,6 +100,20 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
/* If EAGAIN and EWOULDBLOCK are distinct errno values, then we check errno
|
||||||
|
* for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
|
||||||
|
* systems are broken and return EWOULDBLOCK when they should return EAGAIN
|
||||||
|
*/
|
||||||
|
#ifndef WIN32
|
||||||
|
# if (EAGAIN != EWOULDBLOCK)
|
||||||
|
# define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
|
||||||
|
# else
|
||||||
|
# define ETEST(err) (err == EAGAIN)
|
||||||
|
# endif
|
||||||
|
#else /* WIN32 The socket errorcodes differ from the normal errors */
|
||||||
|
#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(XDMCP) || defined(HASXDMAUTH)
|
#if defined(XDMCP) || defined(HASXDMAUTH)
|
||||||
typedef Bool (*ValidatorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
|
typedef Bool (*ValidatorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
|
||||||
typedef Bool (*GeneratorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
|
typedef Bool (*GeneratorFunc) (ARRAY8Ptr Auth, ARRAY8Ptr Data, int packet_type);
|
||||||
|
|
Loading…
Reference in New Issue