# HG changeset patch # User Bruno Haible # Date 1232494193 -3600 # Node ID 90ff3553a1d73ac507facf763f27941ad8ad649d # Parent e57a59a1c129a63db696f09b033fcc74b0374190 Don't assume that EOPNOTSUPP exists. diff --git a/ChangeLog b/ChangeLog --- 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 --- 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;