common: less const argv
This commit is contained in:
parent
f703d615d8
commit
6d29c196ac
24
cmdline.c
24
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]);
|
||||
|
2
common.h
2
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;
|
||||
|
Loading…
Reference in New Issue
Block a user