commit: 8b8edc29705b843988b97242942a409241c182eb
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Wed Jul 16 19:48:03 2014 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Jul 16 19:48:03 2014 +0000
URL:
http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=8b8edc29
style fixes
---
src/rc/rc-selinux.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/rc/rc-selinux.c b/src/rc/rc-selinux.c
index 8e780c9..7c1ee80 100644
--- a/src/rc/rc-selinux.c
+++ b/src/rc/rc-selinux.c
@@ -40,8 +40,7 @@
static struct selabel_handle *hnd = NULL;
-int
-selinux_util_label(const char *path)
+int selinux_util_label(const char *path)
{
int retval = 0;
int enforce;
@@ -52,12 +51,12 @@ selinux_util_label(const char *path)
if (retval < 0)
return retval;
- if (NULL == hnd)
+ if (!hnd)
return (enforce) ? -1 : 0;
retval = lstat(path, &st);
if (retval < 0) {
- if (ENOENT == errno)
+ if (errno == ENOENT)
return 0;
return (enforce) ? -1 : 0;
}
@@ -65,7 +64,7 @@ selinux_util_label(const char *path)
/* lookup the context */
retval = selabel_lookup_raw(hnd, &con, path, st.st_mode);
if (retval < 0) {
- if (ENOENT == errno)
+ if (errno == ENOENT)
return 0;
return (enforce) ? -1 : 0;
}
@@ -74,9 +73,9 @@ selinux_util_label(const char *path)
retval = lsetfilecon(path, con);
freecon(con);
if (retval < 0) {
- if (ENOENT == errno)
+ if (errno == ENOENT)
return 0;
- if (ENOTSUP == errno)
+ if (errno == ENOTSUP)
return 0;
return (enforce) ? -1 : 0;
}
@@ -88,8 +87,7 @@ selinux_util_label(const char *path)
* Open the label handle
* returns 1 on success, 0 if no selinux, negative on error
*/
-int
-selinux_util_open(void)
+int selinux_util_open(void)
{
int retval = 0;
@@ -98,7 +96,7 @@ selinux_util_open(void)
return retval;
hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
- if (NULL == hnd)
+ if (!hnd)
return -2;
return 1;
@@ -108,8 +106,7 @@ selinux_util_open(void)
* Close the label handle
* returns 1 on success, 0 if no selinux, negative on error
*/
-int
-selinux_util_close(void)
+int selinux_util_close(void)
{
int retval = 0;