From: Bruno Haible Date: Tue, 20 Jan 2009 23:29:53 +0000 (+0100) Subject: Don't assume that EOPNOTSUPP exists. X-Git-Tag: v0.1~6424 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=fd970ddf7fa72fa672383527aec84f71c061a232;p=gnulib.git Don't assume that EOPNOTSUPP exists. --- diff --git a/ChangeLog b/ChangeLog index 8ebd4aabf..521eb24d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-20 Bruno Haible + + Fix compilation failure on mingw. + * tests/test-link.c (main): Don't assume that EOPNOTSUPP exists. + 2009-01-20 Michael Gold (tiny change) * doc/c-strtod.texi: Mention a couple of restrictions. diff --git a/tests/test-link.c b/tests/test-link.c index a35892113..250a82118 100644 --- a/tests/test-link.c +++ b/tests/test-link.c @@ -46,10 +46,17 @@ main (int argc, char **argv) { /* 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;