aboutsummaryrefslogtreecommitdiff
path: root/src/lib/mhd_itc.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-04-08 15:12:20 +0200
committerChristian Grothoff <christian@grothoff.org>2019-04-08 15:12:20 +0200
commit83a86be948420f7bd902ceee9d661fc208eec1cd (patch)
treea56c5475a1674267a0d07f79e10d377ed509b695 /src/lib/mhd_itc.h
parent302d381133a26e6223766eea094a784993022fc4 (diff)
downloadlibmicrohttpd-83a86be948420f7bd902ceee9d661fc208eec1cd.tar.gz
libmicrohttpd-83a86be948420f7bd902ceee9d661fc208eec1cd.zip
fix close() checks
Diffstat (limited to 'src/lib/mhd_itc.h')
-rw-r--r--src/lib/mhd_itc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/mhd_itc.h b/src/lib/mhd_itc.h
index 7bfccf30..01331f13 100644
--- a/src/lib/mhd_itc.h
+++ b/src/lib/mhd_itc.h
@@ -108,11 +108,13 @@ static const uint64_t _MHD_itc_wr_data = 1;
108 (void)__r; } while(0) 108 (void)__r; } while(0)
109 109
110/** 110/**
111 * Destroy previously initialised ITC 111 * Destroy previously initialised ITC. Note that close()
112 * on some platforms returns odd errors, so we ONLY fail
113 * if the errno is EBADF.
112 * @param itc the itc to destroy 114 * @param itc the itc to destroy
113 * @return non-zero if succeeded, zero otherwise 115 * @return non-zero if succeeded, zero otherwise
114 */ 116 */
115#define MHD_itc_destroy_(itc) ((0 != close ((itc).fd)) || (EBADF != errno)) 117#define MHD_itc_destroy_(itc) ((0 == close ((itc).fd)) || (EBADF != errno))
116 118
117/** 119/**
118 * Check whether ITC has valid value. 120 * Check whether ITC has valid value.