summaryrefslogtreecommitdiff
path: root/src/libstddjb/error_isalready.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-07-22 13:58:11 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-07-22 13:58:11 +0000
commitd44819ae9c55f4d3c0f347b2640f58a2deddebb4 (patch)
tree040c9d2c5ce734047af365df4b86edc33379dd70 /src/libstddjb/error_isalready.c
parent8923a6ffa3da869b5fc56b9b1f698f483e3180a4 (diff)
downloadskalibs-d44819ae9c55f4d3c0f347b2640f58a2deddebb4.tar.xz
Factor all the BSD complaints into one new header
Diffstat (limited to 'src/libstddjb/error_isalready.c')
-rw-r--r--src/libstddjb/error_isalready.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstddjb/error_isalready.c b/src/libstddjb/error_isalready.c
new file mode 100644
index 0000000..db63932
--- /dev/null
+++ b/src/libstddjb/error_isalready.c
@@ -0,0 +1,14 @@
+/* ISC license. */
+
+#include <skalibs/bsdsnowflake.h>
+#include <errno.h>
+#include <skalibs/error.h>
+
+int error_isalready (int e)
+{
+ return e == EALREADY || e == EINPROGRESS
+#ifdef SKALIBS_BSD_SUCKS
+ || e == ADDRINUSE
+#endif
+ ;
+}