chiark / gitweb /
Always check asprintf return code
[elogind.git] / src / shared / label.c
index 3b7b86e8fadcd30a10aa246dd11ab5056e270d2b..25a8b361b7c9c86e23139976e16acc910f717342 100644 (file)
@@ -27,9 +27,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#ifdef HAVE_XATTR
 #include <sys/xattr.h>
-#endif
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #include <selinux/label.h>
@@ -295,6 +293,8 @@ int label_socket_set(const char *label) {
 void label_context_clear(void) {
 
 #ifdef HAVE_SELINUX
+        PROTECT_ERRNO;
+
         if (!use_selinux())
                 return;
 
@@ -305,6 +305,8 @@ void label_context_clear(void) {
 void label_socket_clear(void) {
 
 #ifdef HAVE_SELINUX
+        PROTECT_ERRNO;
+
         if (!use_selinux())
                 return;