]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
nsenter: rename --exec/-e to --no-fork/-F
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 21 Jan 2013 06:38:05 +0000 (01:38 -0500)
committerKarel Zak <kzak@redhat.com>
Fri, 25 Jan 2013 14:32:35 +0000 (15:32 +0100)
The naming of this option was really confusing.
Just rename it for clarity.

[kzak@redhat.com: rebase to original code without --all]

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/nsenter.1
sys-utils/nsenter.c

index 0fbb645a37db5b13f3b42663560cfd618abb8d75..3bc42a4cbd77cdfb99ad87795b74cc79d4d34a92 100644 (file)
@@ -87,7 +87,7 @@ Set the working directory.
 If no directory is specified set the working directory to the working directory of the target process.
 If directory is specified set the working directory to the specified directory.
 .TP
-.BR \-e , " \-\-exec"
+.BR \-F , " \-\-no-fork"
 Don't fork before exec'ing the specified program.  By default when entering
 a pid namespace enter calls fork before calling exec so that the children will
 be in the newly entered pid namespace.
index f377f2b849fc53f59738c00a5a7453009221dd3c..229350287d1c1c60741a4f63df1f77369ba5cac5 100644 (file)
@@ -70,9 +70,9 @@ static void usage(int status)
                " -n, --net   [=<file>]  enter network namespace\n"
                " -p, --pid   [=<file>]  enter pid namespace\n"
                " -U, --user  [=<file>]  enter user namespace\n"
-               " -e, --exec             don't fork before exec'ing <program>\n"
                " -r, --root  [=<dir>]   set the root directory\n"
-               " -w, --wd    [=<dir>]   set the working directory\n"), out);
+               " -w, --wd    [=<dir>]   set the working directory\n"
+               " -F, --no-fork          don't fork before exec'ing <program>\n"), out);
        fputs(USAGE_SEPARATOR, out);
        fputs(USAGE_HELP, out);
        fputs(USAGE_VERSION, out);
@@ -166,24 +166,25 @@ int main(int argc, char *argv[])
                { "net", optional_argument, NULL, 'n' },
                { "pid", optional_argument, NULL, 'p' },
                { "user", optional_argument, NULL, 'U' },
-               { "exec", no_argument, NULL, 'e' },
                { "root", optional_argument, NULL, 'r' },
                { "wd", optional_argument, NULL, 'w' },
+               { "no-fork", no_argument, NULL, 'F' },
                { NULL, 0, NULL, 0 }
        };
 
        struct namespace_file *nsfile;
-       int do_fork = 0;
        int c, namespaces = 0;
-       bool do_rd = false, do_wd = false;
+       bool do_rd = false, do_wd = false, do_fork = false;
 
        setlocale(LC_MESSAGES, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
        atexit(close_stdout);
 
-       while((c = getopt_long(argc, argv, "hVt:m::u::i::n::p::U::er::w::", longopts, NULL)) != -1) {
-               switch(c) {
+       while ((c =
+               getopt_long(argc, argv, "hVt:m::u::i::n::p::U::r::w::F",
+                           longopts, NULL)) != -1) {
+               switch (c) {
                case 'h':
                        usage(EXIT_SUCCESS);
                case 'V':
@@ -217,7 +218,7 @@ int main(int argc, char *argv[])
                                namespaces |= CLONE_NEWNET;
                        break;
                case 'p':
-                       do_fork = 1;
+                       do_fork = true;
                        if (optarg)
                                open_namespace_fd(CLONE_NEWPID, optarg);
                        else
@@ -229,8 +230,8 @@ int main(int argc, char *argv[])
                        else
                                namespaces |= CLONE_NEWUSER;
                        break;
-               case 'e':
-                       do_fork = 0;
+               case 'F':
+                       do_fork = false;
                        break;
                case 'r':
                        if (optarg)