summaryrefslogtreecommitdiff
path: root/otherlibs/unix/unixsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/unixsupport.c')
-rw-r--r--otherlibs/unix/unixsupport.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/otherlibs/unix/unixsupport.c b/otherlibs/unix/unixsupport.c
index 3138115a6f..4c91adb104 100644
--- a/otherlibs/unix/unixsupport.c
+++ b/otherlibs/unix/unixsupport.c
@@ -165,7 +165,11 @@
#define ESOCKTNOSUPPORT (-1)
#endif
#ifndef EOPNOTSUPP
-#define EOPNOTSUPP (-1)
+# ifdef ENOTSUP
+# define EOPNOTSUPP ENOTSUP
+# else
+# define EOPNOTSUPP (-1)
+# endif
#endif
#ifndef EPFNOSUPPORT
#define EPFNOSUPPORT (-1)
@@ -252,6 +256,11 @@ value unix_error_of_code (int errcode)
int errconstr;
value err;
+#if defined(ENOTSUP) && (EOPNOTSUPP != ENOTSUP)
+ if (errcode == ENOTSUP)
+ errcode = EOPNOTSUPP;
+#endif
+
errconstr =
cst_to_constr(errcode, error_table, sizeof(error_table)/sizeof(int), -1);
if (errconstr == Val_int(-1)) {