[PATCH 63/84] libselinux: Use ENOTSUP instead of EOPNOTSUPP for

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlD+qEkACgkQrlYvE4MpobP4BQCgoc9VOznuwXSsi2n5O2lPGpRI
k34AoNuCXMLQAgrMBULVDmcIEJ7NMqME
=cT7L
-----END PGP SIGNATURE-----
>From 8b49d6242b16d3c993967d13e383322808ce0765 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@xxxxxxxxxx>
Date: Tue, 13 Nov 2012 21:17:11 +0100
Subject: [PATCH 63/84] 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 <guillem@xxxxxxxxxx>
Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 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 c88d515..3395c9f 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 67e4463..eb2ce8a 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 a53f56e..58dc807 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)
-- 
1.8.1


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux