/*
+--------------------------------------------------------------------+
- | libmemcached - C/C++ Client Library for memcached |
+ | libmemcached-awesome - C/C++ Client Library for memcached |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted under the terms of the BSD license. |
#if defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
#endif
-
-#if defined(HAVE_TIME_H)
-# include <time.h>
-#endif
+#include <time.h>
#include "ms_setting.h"
#include "ms_thread.h"
return -1;
}
if (res == -1) {
- if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
+ if ((errno == EAGAIN) || (EAGAIN != EWOULDBLOCK && errno == EWOULDBLOCK))
break;
/* Should close on unhandled errors. */
ms_conn_set_state(c, conn_closing);
}
return TRANSMIT_INCOMPLETE;
}
- if ((res == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {
+ if ((res == -1) && ((errno == EAGAIN) || (EAGAIN != EWOULDBLOCK && errno == EWOULDBLOCK))) {
if (!ms_update_event(c, EV_WRITE | EV_PERSIST)) {
fprintf(stderr, "Couldn't update event.\n");
ms_conn_set_state(c, conn_closing);