From dd62ffcdad44eac2bc21f57a98bf1a57c893f989 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 6 Sep 2009 22:36:55 +0200 Subject: [PATCH] Set errno to ENOSYS when a function is entirely unsupported. --- ChangeLog | 8 ++++++++ lib/chown.c | 2 +- lib/lchown.c | 2 +- modules/chown | 1 - 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07a30026e9..a1758037d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-06 Bruno Haible + + 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. + 2009-09-06 Bruno Haible * doc/posix-headers/fcntl.texi (AT_*): Mention affected platforms. diff --git a/lib/chown.c b/lib/chown.c index cca1d7f3c6..b851cbc4c0 100644 --- a/lib/chown.c +++ b/lib/chown.c @@ -103,7 +103,7 @@ rpl_chown (const char *file, uid_t uid, gid_t gid) return chown (file, uid, gid); #else /* !HAVE_CHOWN */ - errno = EOPNOTSUPP; + errno = ENOSYS; return -1; #endif } diff --git a/lib/lchown.c b/lib/lchown.c index 10ba1c9e5c..8cf10dd0c2 100644 --- a/lib/lchown.c +++ b/lib/lchown.c @@ -52,7 +52,7 @@ lchown (const char *file, uid_t uid, gid_t gid) return chown (file, uid, gid); #else /* !HAVE_CHOWN */ - errno = EOPNOTSUPP; + errno = ENOSYS; return -1; #endif } diff --git a/modules/chown b/modules/chown index 7cd07f590b..cf9921089b 100644 --- a/modules/chown +++ b/modules/chown @@ -7,7 +7,6 @@ lib/fchown-stub.c m4/chown.m4 Depends-on: -errno open unistd sys_stat -- 2.30.2