Skip to contentSkip to conversation

policycoreutils: use bool instead of int

PATCH In review Kalevi Kolttonen 2 participants 2 messages Jun 14 – Jun 15 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policycoreutils: use bool instead of int

---
 policycoreutils/setsebool/setsebool.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
policycoreutils/setsebool/setsebool.c +7 -6
index d85b2a33..3cf1f063 100644
@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -17,9 +18,9 @@
 #include <semanage/boolean_record.h>
 #include <errno.h>
 
-static int permanent = 0;
-static int no_reload = 0;
-static int verbose = 0;
+static bool permanent = false;
+static bool no_reload = false;
+static bool verbose = false;
 
 int setbool(char **list, size_t start, size_t end);
 
@@ -44,13 +45,13 @@ int main(int argc, char **argv)
 
 		switch (clflag) {
 		case 'P':
-			permanent = 1;
+			permanent = true;
 			break;
 		case 'N':
-			no_reload = 1;
+			no_reload = true;
 			break;
 		case 'V':
-			verbose = 1;
+			verbose = true;
 			break;
 		default:
 			usage();
Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Kalevi Kolttonen
Quoted 48 lines
---
 policycoreutils/setsebool/setsebool.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
policycoreutils/setsebool/setsebool.c +7 -7
index d85b2a33..3cf1f063 100644
@@ -1,4 +1,5 @@
 #include <unistd.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -17,9 +18,9 @@
 #include <semanage/boolean_record.h>
 #include <errno.h>
 
-static int permanent = 0;
-static int no_reload = 0;
-static int verbose = 0;
+static bool permanent = false;
+static bool no_reload = false;
+static bool verbose = false;
 
 int setbool(char **list, size_t start, size_t end);
 
@@ -44,13 +45,13 @@ int main(int argc, char **argv)
 
                switch (clflag) {
                case 'P':
-                       permanent = 1;
+                       permanent = true;
                        break;
                case 'N':
-                       no_reload = 1;
+                       no_reload = true;
                        break;
                case 'V':
-                       verbose = 1;
+                       verbose = true;
                        break;
                default:
                        usage();
--

2.54.0