[PATCH 11/46] src/security: use #pragma once in headers

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

 



Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 src/security/security_apparmor.h | 13 +++++--------
 src/security/security_dac.h      |  7 ++-----
 src/security/security_driver.h   | 11 ++++-------
 src/security/security_manager.h  | 13 +++++--------
 src/security/security_nop.h      |  7 ++-----
 src/security/security_selinux.h  |  5 +----
 src/security/security_stack.h    |  7 ++-----
 src/security/security_util.h     |  5 +----
 8 files changed, 22 insertions(+), 46 deletions(-)

diff --git a/src/security/security_apparmor.h b/src/security/security_apparmor.h
index 730f72ff98..7b54eefd8d 100644
--- a/src/security/security_apparmor.h
+++ b/src/security/security_apparmor.h
@@ -16,15 +16,12 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_SECURITY_APPARMOR_H
-# define LIBVIRT_SECURITY_APPARMOR_H
+#pragma once
 
-# include "security_driver.h"
+#include "security_driver.h"
 
 extern virSecurityDriver virAppArmorSecurityDriver;
 
-# define AA_PREFIX  "libvirt-"
-# define PROFILE_NAME_SIZE  8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */
-# define MAX_FILE_LEN       (1024*1024*10)  /* 10MB limit for sanity check */
-
-#endif /* LIBVIRT_SECURITY_APPARMOR_H */
+#define AA_PREFIX  "libvirt-"
+#define PROFILE_NAME_SIZE  8 + VIR_UUID_STRING_BUFLEN /* AA_PREFIX + uuid */
+#define MAX_FILE_LEN       (1024*1024*10)  /* 10MB limit for sanity check */
diff --git a/src/security/security_dac.h b/src/security/security_dac.h
index 318ca06d75..444e5dcf89 100644
--- a/src/security/security_dac.h
+++ b/src/security/security_dac.h
@@ -18,10 +18,9 @@
  * POSIX DAC security driver
  */
 
-#ifndef LIBVIRT_SECURITY_DAC_H
-# define LIBVIRT_SECURITY_DAC_H
+#pragma once
 
-# include "security_driver.h"
+#include "security_driver.h"
 
 extern virSecurityDriver virSecurityDriverDAC;
 
@@ -37,5 +36,3 @@ void virSecurityDACSetMountNamespace(virSecurityManagerPtr mgr,
 
 void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr,
                                     virSecurityManagerDACChownCallback chownCallback);
-
-#endif /* LIBVIRT_SECURITY_DAC_H */
diff --git a/src/security/security_driver.h b/src/security/security_driver.h
index 36cf9da037..9d0ab4e14a 100644
--- a/src/security/security_driver.h
+++ b/src/security/security_driver.h
@@ -16,13 +16,12 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_SECURITY_DRIVER_H
-# define LIBVIRT_SECURITY_DRIVER_H
+#pragma once
 
-# include "internal.h"
-# include "domain_conf.h"
+#include "internal.h"
+#include "domain_conf.h"
 
-# include "security_manager.h"
+#include "security_manager.h"
 
 /*
  * Return values for security driver probing: the driver will determine
@@ -216,5 +215,3 @@ struct _virSecurityDriver {
 
 virSecurityDriverPtr virSecurityDriverLookup(const char *name,
                                              const char *virtDriver);
-
-#endif /* LIBVIRT_SECURITY_DRIVER_H */
diff --git a/src/security/security_manager.h b/src/security/security_manager.h
index 7e174a33ee..88ed9919a2 100644
--- a/src/security/security_manager.h
+++ b/src/security/security_manager.h
@@ -18,12 +18,11 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_SECURITY_MANAGER_H
-# define LIBVIRT_SECURITY_MANAGER_H
+#pragma once
 
-# include "domain_conf.h"
-# include "vircommand.h"
-# include "virstoragefile.h"
+#include "domain_conf.h"
+#include "vircommand.h"
+#include "virstoragefile.h"
 
 typedef struct _virSecurityManager virSecurityManager;
 typedef virSecurityManager *virSecurityManagerPtr;
@@ -36,7 +35,7 @@ typedef enum {
     VIR_SECURITY_MANAGER_MOUNT_NAMESPACE    = 1 << 5,
 } virSecurityManagerNewFlags;
 
-# define VIR_SECURITY_MANAGER_NEW_MASK \
+#define VIR_SECURITY_MANAGER_NEW_MASK \
     (VIR_SECURITY_MANAGER_DEFAULT_CONFINED  | \
      VIR_SECURITY_MANAGER_REQUIRE_CONFINED  | \
      VIR_SECURITY_MANAGER_PRIVILEGED)
@@ -207,5 +206,3 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr,
 void
 virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr,
                                  virSecurityManagerMetadataLockStatePtr *state);
-
-#endif /* LIBVIRT_SECURITY_MANAGER_H */
diff --git a/src/security/security_nop.h b/src/security/security_nop.h
index 31e46420b1..94ced9802c 100644
--- a/src/security/security_nop.h
+++ b/src/security/security_nop.h
@@ -17,11 +17,8 @@
  *
  */
 
-#ifndef LIBVIRT_SECURITY_NOP_H
-# define LIBVIRT_SECURITY_NOP_H
+#pragma once
 
-# include "security_driver.h"
+#include "security_driver.h"
 
 extern virSecurityDriver virSecurityDriverNop;
-
-#endif /* LIBVIRT_SECURITY_NOP_H */
diff --git a/src/security/security_selinux.h b/src/security/security_selinux.h
index dfd2b73baa..eb992bd53b 100644
--- a/src/security/security_selinux.h
+++ b/src/security/security_selinux.h
@@ -16,9 +16,6 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_SECURITY_SELINUX_H
-# define LIBVIRT_SECURITY_SELINUX_H
+#pragma once
 
 extern virSecurityDriver virSecurityDriverSELinux;
-
-#endif /* LIBVIRT_SECURITY_SELINUX_H */
diff --git a/src/security/security_stack.h b/src/security/security_stack.h
index 8c264d967a..e35f149bed 100644
--- a/src/security/security_stack.h
+++ b/src/security/security_stack.h
@@ -18,10 +18,9 @@
  * Stacked security driver
  */
 
-#ifndef LIBVIRT_SECURITY_STACK_H
-# define LIBVIRT_SECURITY_STACK_H
+#pragma once
 
-# include "security_driver.h"
+#include "security_driver.h"
 
 extern virSecurityDriver virSecurityDriverStack;
 
@@ -34,5 +33,3 @@ virSecurityStackGetPrimary(virSecurityManagerPtr mgr);
 
 virSecurityManagerPtr*
 virSecurityStackGetNested(virSecurityManagerPtr mgr);
-
-#endif /* LIBVIRT_SECURITY_STACK_H */
diff --git a/src/security/security_util.h b/src/security/security_util.h
index bc977ed65d..aacac5c64c 100644
--- a/src/security/security_util.h
+++ b/src/security/security_util.h
@@ -16,8 +16,7 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_SECURITY_UTIL_H
-# define LIBVIRT_SECURITY_UTIL_H
+#pragma once
 
 int
 virSecurityGetRememberedLabel(const char *name,
@@ -28,5 +27,3 @@ int
 virSecuritySetRememberedLabel(const char *name,
                               const char *path,
                               const char *label);
-
-#endif /* LIBVIRT_SECURITY_UTIL_H */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux