common: less const argv
authorRobert Swiecki <robert@swiecki.net>
Sat, 7 Oct 2017 22:36:13 +0000 (00:36 +0200)
committerRobert Swiecki <robert@swiecki.net>
Sat, 7 Oct 2017 22:36:13 +0000 (00:36 +0200)
cmdline.c
common.h
contain.h

index 74c9351..1189702 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -644,7 +644,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                                dst = dst ? dst : optarg;
                                if (!mountAddMountPtTail
                                    (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
-                                    /* options= */ "", MS_BIND | MS_REC | MS_RDONLY, /* isDir= */
+                                                                                       /* options= */ "", MS_BIND | MS_REC | MS_RDONLY,
+                                                                                       /* isDir= */
                                     NS_DIR_MAYBE, /* mandatory= */ true, NULL, NULL, NULL, 0,
                                     /* is_symlink= */ false)) {
                                        return false;
@@ -657,7 +658,8 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                                if (!mountAddMountPtTail
                                    (nsjconf, /* src= */ optarg, dst, /* fs_type= */ "",
                                     /* options= */ "", MS_BIND | MS_REC, /* isDir= */ NS_DIR_MAYBE,
-                                    /* mandatory= */ true, NULL, NULL, NULL, 0, /* is_symlink= */
+                                                                                       /* mandatory= */ true, NULL, NULL, NULL, 0,
+                                                                                       /* is_symlink= */
                                     false)) {
                                        return false;
                                }
@@ -745,10 +747,10 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
        }
 
        if (nsjconf->mount_proc == true) {
-               if (!mountAddMountPtHead
-                   (nsjconf, /* src= */ NULL, "/proc", "proc", "",
-                    nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true,
-                    NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
+               if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/proc", "proc", "",
+                                        nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true,
+                                        /* mandatory= */ true,
+                                        NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
                        return false;
                }
        }
@@ -761,10 +763,10 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                        return false;
                }
        } else {
-               if (!mountAddMountPtHead
-                   (nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
-                    nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true, /* mandatory= */ true,
-                    NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
+               if (!mountAddMountPtHead(nsjconf, /* src= */ NULL, "/", "tmpfs", /* options= */ "",
+                                        nsjconf->is_root_rw ? 0 : MS_RDONLY, /* isDir= */ true,
+                                        /* mandatory= */ true,
+                                        NULL, NULL, NULL, 0, /* is_symlink= */ false)) {
                        return false;
                }
        }
@@ -791,7 +793,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
        }
 
        if (argv[optind]) {
-               nsjconf->argv = (const char *const *)&argv[optind];
+               nsjconf->argv = (const char **)&argv[optind];
        }
        if (nsjconf->argv == NULL || nsjconf->argv[0] == NULL) {
                cmdlineUsage(argv[0]);
index 632b2af..047df76 100644 (file)
--- a/common.h
+++ b/common.h
@@ -122,7 +122,7 @@ struct nsjconf_t {
        const char *exec_file;
        const char *hostname;
        const char *cwd;
-       const char *const *argv;
+       const char **argv;
        int port;
        const char *bindhost;
        int log_fd;
index edba108..31c8714 100644 (file)
--- a/contain.h
+++ b/contain.h
@@ -26,7 +26,7 @@
 
 #include "common.h"
 
-bool containSetupFD(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_err);
+bool containSetupFD(struct nsjconf_t * nsjconf, int fd_in, int fd_out, int fd_err);
 bool containContain(struct nsjconf_t *nsjconf);
 
 #endif                         /* NS_CONTAIN_H */