s3:nmbd: Use C99 initializer for poptOption in nmbd
authorAndreas Schneider <asn@samba.org>
Mon, 14 Jan 2019 09:56:08 +0000 (10:56 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 28 Jan 2019 09:29:16 +0000 (10:29 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/nmbd/nmbd.c

index 9d6cac99a63de02c21ddc210cabc369730f2b858..fcb9dc4ee75f7f18a8a8b9204195fa7a8150ee31 100644 (file)
@@ -788,16 +788,65 @@ static bool open_sockets(bool isdaemon, int port)
                OPT_LOG_STDOUT
        };
        struct poptOption long_options[] = {
-       POPT_AUTOHELP
-       {"daemon", 'D', POPT_ARG_NONE, NULL, OPT_DAEMON, "Become a daemon(default)" },
-       {"interactive", 'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE, "Run interactive (not a daemon)" },
-       {"foreground", 'F', POPT_ARG_NONE, NULL, OPT_FORK, "Run daemon in foreground (for daemontools & etc)" },
-       {"no-process-group", 0, POPT_ARG_NONE, NULL, OPT_NO_PROCESS_GROUP, "Don't create a new process group" },
-       {"log-stdout", 'S', POPT_ARG_NONE, NULL, OPT_LOG_STDOUT, "Log to stdout" },
-       {"hosts", 'H', POPT_ARG_STRING, &p_lmhosts, 0, "Load a netbios hosts file"},
-       {"port", 'p', POPT_ARG_INT, &global_nmb_port, 0, "Listen on the specified port" },
-       POPT_COMMON_SAMBA
-       { NULL }
+               POPT_AUTOHELP
+               {
+                       .longName   = "daemon",
+                       .shortName  = 'D',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = OPT_DAEMON,
+                       .descrip    = "Become a daemon(default)",
+               },
+               {
+                       .longName   = "interactive",
+                       .shortName  = 'i',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = OPT_INTERACTIVE,
+                       .descrip    = "Run interactive (not a daemon)",
+               },
+               {
+                       .longName   = "foreground",
+                       .shortName  = 'F',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = OPT_FORK,
+                       .descrip    = "Run daemon in foreground (for daemontools & etc)",
+               },
+               {
+                       .longName   = "no-process-group",
+                       .shortName  = 0,
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = OPT_NO_PROCESS_GROUP,
+                       .descrip    = "Don't create a new process group",
+               },
+               {
+                       .longName   = "log-stdout",
+                       .shortName  = 'S',
+                       .argInfo    = POPT_ARG_NONE,
+                       .arg        = NULL,
+                       .val        = OPT_LOG_STDOUT,
+                       .descrip    = "Log to stdout",
+               },
+               {
+                       .longName   = "hosts",
+                       .shortName  = 'H',
+                       .argInfo    = POPT_ARG_STRING,
+                       .arg        = &p_lmhosts,
+                       .val        = 0,
+                       .descrip    = "Load a netbios hosts file",
+               },
+               {
+                       .longName   = "port",
+                       .shortName  = 'p',
+                       .argInfo    = POPT_ARG_INT,
+                       .arg        = &global_nmb_port,
+                       .val        = 0,
+                       .descrip    = "Listen on the specified port",
+               },
+               POPT_COMMON_SAMBA
+               POPT_TABLEEND
        };
        TALLOC_CTX *frame;
        NTSTATUS status;