mdev: Rob's #if forest removal
[oweals/busybox.git] / selinux / setfiles.c
index d567f83aae30fafa92d9a5a089204296bcde9817..8185d7810a9dd491228a616ca6f6096e1ee14c01 100644 (file)
@@ -112,7 +112,7 @@ static void inc_err(void)
        }
 }
 
-static void add_exclude(const char *const directory)
+static void add_exclude(const char *directory)
 {
        struct stat sb;
        size_t len;
@@ -554,7 +554,7 @@ int setfiles_main(int argc, char **argv)
        if ((applet_name[0] == 's') && (flags & OPT_c)) {
                FILE *policystream;
 
-               policystream = xfopen(policyfile, "r");
+               policystream = xfopen_for_read(policyfile);
                if (sepol_set_policydb_from_file(policystream) < 0) {
                        bb_error_msg_and_die("sepol_set_policydb_from_file on %s", policyfile);
                }
@@ -575,7 +575,7 @@ int setfiles_main(int argc, char **argv)
        if (flags & OPT_o) {
                outfile = stdout;
                if (NOT_LONE_CHAR(out_filename, '-')) {
-                       outfile = xfopen(out_filename, "w");
+                       outfile = xfopen_for_write(out_filename);
                }
        }
        if (applet_name[0] == 'r') { /* restorecon */
@@ -620,7 +620,7 @@ int setfiles_main(int argc, char **argv)
                FILE *f = stdin;
 
                if (NOT_LONE_CHAR(input_filename, '-'))
-                       f = xfopen(input_filename, "r");
+                       f = xfopen_for_read(input_filename);
                while ((len = getline(&buf, &buf_len, f)) > 0) {
                        buf[len - 1] = '\0';
                        errors |= process_one(buf);