From be2d728599c08e5e4a3cf0cebcc4f7876786cd5c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 13 Nov 2012 21:17:11 +0100 Subject: [PATCH] libselinux: Use ENOTSUP instead of EOPNOTSUPP for getfilecon functions EOPNOTSUPP means "operation not supoorted on socket", and ENOTSUP means "not supported", although per POSIX they can be alised to the same value and on Linux they do, ENOTSUP seems the more correct error code. In addition these function are documented as returning ENOTSUP, and given that they are implemented in means of getxattr(2) which does return ENOTSUP too, this just consolidates their behaviour. Signed-off-by: Guillem Jover Signed-off-by: Eric Paris Acked-by: Dan Walsh --- libselinux/src/fgetfilecon.c | 2 +- libselinux/src/getfilecon.c | 2 +- libselinux/src/lgetfilecon.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libselinux/src/fgetfilecon.c b/libselinux/src/fgetfilecon.c index c88d515d..3395c9f9 100644 --- a/libselinux/src/fgetfilecon.c +++ b/libselinux/src/fgetfilecon.c @@ -39,7 +39,7 @@ int fgetfilecon_raw(int fd, security_context_t * context) out: if (ret == 0) { /* Re-map empty attribute values to errors. */ - errno = EOPNOTSUPP; + errno = ENOTSUP; ret = -1; } if (ret < 0) diff --git a/libselinux/src/getfilecon.c b/libselinux/src/getfilecon.c index 67e4463d..eb2ce8a4 100644 --- a/libselinux/src/getfilecon.c +++ b/libselinux/src/getfilecon.c @@ -39,7 +39,7 @@ int getfilecon_raw(const char *path, security_context_t * context) out: if (ret == 0) { /* Re-map empty attribute values to errors. */ - errno = EOPNOTSUPP; + errno = ENOTSUP; ret = -1; } if (ret < 0) diff --git a/libselinux/src/lgetfilecon.c b/libselinux/src/lgetfilecon.c index a53f56ee..58dc8071 100644 --- a/libselinux/src/lgetfilecon.c +++ b/libselinux/src/lgetfilecon.c @@ -39,7 +39,7 @@ int lgetfilecon_raw(const char *path, security_context_t * context) out: if (ret == 0) { /* Re-map empty attribute values to errors. */ - errno = EOPNOTSUPP; + errno = ENOTSUP; ret = -1; } if (ret < 0)