changeset 11062:90ff3553a1d7

Don't assume that EOPNOTSUPP exists.
author Bruno Haible <bruno@clisp.org>
date Wed, 21 Jan 2009 00:29:53 +0100
parents e57a59a1c129
children 2921cdaa1164
files ChangeLog tests/test-link.c
diffstat 2 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-20  Bruno Haible  <bruno@clisp.org>
+
+	Fix compilation failure on mingw.
+	* tests/test-link.c (main): Don't assume that EOPNOTSUPP exists.
+
 2009-01-20  Michael Gold  <mgold@ncf.ca>  (tiny change)
 
 	* doc/c-strtod.texi: Mention a couple of restrictions.
--- a/tests/test-link.c
+++ b/tests/test-link.c
@@ -46,10 +46,17 @@
     {
       /* If the device does not support hard links, errno is
 	 EPERM on Linux, EOPNOTSUPP on FreeBSD.  */
-      if (errno == EPERM || errno == EOPNOTSUPP)
-	return 77;
-      perror ("link");
-      return 1;
+      switch (errno)
+	{
+	case EPERM:
+#ifdef EOPNOTSUPP
+	case EOPNOTSUPP:
+#endif
+	  return 77;
+	default:
+	  perror ("link");
+	  return 1;
+	}
     }
 
   return 0;