git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
docs: Indent *_va and *_argv functions correctly.
[libguestfs.git]
/
daemon
/
selinux.c
diff --git
a/daemon/selinux.c
b/daemon/selinux.c
index
3b4b9ba
..
0bf6fd2
100644
(file)
--- a/
daemon/selinux.c
+++ b/
daemon/selinux.c
@@
-26,9
+26,24
@@
#include <selinux/selinux.h>
#endif
#include <selinux/selinux.h>
#endif
-#include "
../src/
guestfs_protocol.h"
+#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
#include "daemon.h"
#include "actions.h"
+#include "optgroups.h"
+
+#if defined(HAVE_LIBSELINUX)
+int
+optgroup_selinux_available (void)
+{
+ return 1;
+}
+#else /* !HAVE_LIBSELINUX */
+int
+optgroup_selinux_available (void)
+{
+ return 0;
+}
+#endif /* !HAVE_LIBSELINUX */
/* setcon is only valid under the following circumstances:
* - single threaded
/* setcon is only valid under the following circumstances:
* - single threaded
@@
-45,8
+60,7
@@
do_setcon (const char *context)
return 0;
#else
return 0;
#else
- reply_with_error ("%s is not available", __func__);
- return -1;
+ NOT_AVAILABLE (-1);
#endif
}
#endif
}
@@
-71,7
+85,6
@@
do_getcon (void)
return r; /* caller frees */
#else
return r; /* caller frees */
#else
- reply_with_error ("%s is not available", __func__);
- return NULL;
+ NOT_AVAILABLE (NULL);
#endif
}
#endif
}