From cc6609eed2d0f399b8b6d17921860449d3cf23d2 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Tue, 21 Nov 2023 12:40:46 +0100 Subject: [PATCH] tools/xenstored: remove the "-P" command line option The "-P" command line option just results in printing the PID of the xenstored daemon to stdout before stdout is being closed. The same information can be retrieved from the PID file via the "-F" option. Remove the redundant "-P" option. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstored/core.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c index 6dd810c092..1f5505d05e 100644 --- a/tools/xenstored/core.c +++ b/tools/xenstored/core.c @@ -2653,7 +2653,6 @@ static void usage(void) " -F, --pid-file giving a file for the daemon's pid to be written,\n" " -H, --help to output this message,\n" " -N, --no-fork to request that the daemon does not fork,\n" -" -P, --output-pid to request that the pid of the daemon is output,\n" " -T, --trace-file giving the file for logging, and\n" " --trace-control=+ activate a specific \n" " --trace-control=- deactivate a specific \n" @@ -2702,7 +2701,6 @@ static struct option options[] = { { "help", 0, NULL, 'H' }, { "no-fork", 0, NULL, 'N' }, { "priv-domid", 1, NULL, 'p' }, - { "output-pid", 0, NULL, 'P' }, { "entry-size", 1, NULL, 'S' }, { "trace-file", 1, NULL, 'T' }, { "trace-control", 1, NULL, 1 }, @@ -2825,7 +2823,6 @@ int main(int argc, char *argv[]) int opt; int sock_pollfd_idx = -1; bool dofork = true; - bool outputpid = false; bool live_update = false; const char *pidfile = NULL; int timeout; @@ -2834,7 +2831,7 @@ int main(int argc, char *argv[]) orig_argv = argv; while ((opt = getopt_long(argc, argv, - "E:F:H::KNPS:t:A:M:Q:q:T:RW:w:U", + "E:F:H::KNS:t:A:M:Q:q:T:RW:w:U", options, NULL)) != -1) { switch (opt) { case 'E': @@ -2849,9 +2846,6 @@ int main(int argc, char *argv[]) case 'N': dofork = false; break; - case 'P': - outputpid = true; - break; case 'R': recovery = false; break; @@ -2947,11 +2941,6 @@ int main(int argc, char *argv[]) dom0_init(); } - if (outputpid) { - printf("%ld\n", (long)getpid()); - fflush(stdout); - } - /* redirect to /dev/null now we're ready to accept connections */ if (dofork && !live_update) finish_daemonize();