summaryrefslogtreecommitdiff
path: root/src/libstddjb/error_temp.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
commit3534b428629be185e096be99e3bd5fdfe32d5544 (patch)
tree210ef3198ed66bc7f7b7bf6a85e4579f455e5a36 /src/libstddjb/error_temp.c
downloadskalibs-3534b428629be185e096be99e3bd5fdfe32d5544.tar.xz
initial commit with rc for skalibs-2.0.0.0
Diffstat (limited to 'src/libstddjb/error_temp.c')
-rw-r--r--src/libstddjb/error_temp.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/libstddjb/error_temp.c b/src/libstddjb/error_temp.c
new file mode 100644
index 0000000..48a54f5
--- /dev/null
+++ b/src/libstddjb/error_temp.c
@@ -0,0 +1,78 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/error.h>
+
+int error_temp (register int e)
+{
+ if (error_isagain(e)) return 1 ;
+ switch (e)
+ {
+ case 0 :
+ case EINTR :
+ case ENOMEM :
+ case ETXTBSY :
+ case EIO :
+ case ETIMEDOUT :
+ case ENOBUFS :
+#ifdef EDEADLK
+ case EDEADLK :
+#endif
+#ifdef EBUSY
+ case EBUSY :
+#endif
+#ifdef ENFILE
+ case ENFILE :
+#endif
+#ifdef EFBIG
+ case EFBIG :
+#endif
+#ifdef ENOSPC
+ case ENOSPC :
+#endif
+#ifdef ENETDOWN
+ case ENETDOWN :
+#endif
+#ifdef ENETUNREACH
+ case ENETUNREACH :
+#endif
+#ifdef ENETRESET
+ case ENETRESET :
+#endif
+#ifdef ECONNABORTED
+ case ECONNABORTED :
+#endif
+#ifdef ECONNRESET
+ case ECONNRESET :
+#endif
+#ifdef ETOOMANYREFS
+ case ETOOMANYREFS :
+#endif
+#ifdef ECONNREFUSED
+ case ECONNREFUSED :
+#endif
+#ifdef EHOSTDOWN
+ case EHOSTDOWN :
+#endif
+#ifdef EHOSTUNREACH
+ case EHOSTUNREACH :
+#endif
+#ifdef EPROCLIM
+ case EPROCLIM :
+#endif
+#ifdef EUSERS
+ case EUSERS :
+#endif
+#ifdef EDQUOT
+ case EDQUOT :
+#endif
+#ifdef ESTALE
+ case ESTALE :
+#endif
+#ifdef ENOLCK
+ case ENOLCK :
+#endif
+ return 1 ;
+ default : return 0 ;
+ }
+}