Eric Blake wrote:
> > EOPNOTSUPP is an error code related to sockets. I also see it sometimes on
> > NFS mounts. POSIX [1] describes it as "Operation not supported on socket".
> > Probably ENOSYS ("Function not supported.") is a better error code.
>
> ENOSYS does make more sense (even though POSIX allows ENOSYS and
> EOPNOTSUPP to be equal, it does not require it). You're welcome to make
> that change, if I don't get to it first.
Done:
2009-09-06 Bruno Haible <[email protected]>
Set errno to ENOSYS when a function is entirely unsupported.
* lib/chown.c (rpl_chown) [!HAVE_CHOWN]: Set errno to ENOSYS instead of
EOPNOTSUPP.
* lib/lchown.c (lchown) [!HAVE_CHOWN]: Likewise.
* modules/chown (Depends-on): Remove errno.
--- lib/chown.c.orig 2009-09-06 22:33:33.000000000 +0200
+++ lib/chown.c 2009-09-06 22:31:50.000000000 +0200
@@ -103,7 +103,7 @@
return chown (file, uid, gid);
#else /* !HAVE_CHOWN */
- errno = EOPNOTSUPP;
+ errno = ENOSYS;
return -1;
#endif
}
--- lib/lchown.c.orig 2009-09-06 22:33:33.000000000 +0200
+++ lib/lchown.c 2009-09-06 22:31:50.000000000 +0200
@@ -52,7 +52,7 @@
return chown (file, uid, gid);
#else /* !HAVE_CHOWN */
- errno = EOPNOTSUPP;
+ errno = ENOSYS;
return -1;
#endif
}
--- modules/chown.orig 2009-09-06 22:33:33.000000000 +0200
+++ modules/chown 2009-09-06 22:31:31.000000000 +0200
@@ -7,7 +7,6 @@
m4/chown.m4
Depends-on:
-errno
open
unistd
sys_stat