]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move the --nodaemonize option from K to Z so we don't conflict with SuSE custom dhcpc...
authorRoy Marples <roy@marples.name>
Tue, 8 Jul 2008 16:02:51 +0000 (16:02 +0000)
committerRoy Marples <roy@marples.name>
Tue, 8 Jul 2008 16:02:51 +0000 (16:02 +0000)
dhcpcd.8.in
dhcpcd.c

index b8a8c25677ae47b1e28eb258b5e7a675e62b7010..c008a5ac26d6692864459fdcf16c48e284f18246 100644 (file)
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Jul 04, 2008
+.Dd Jul 08, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
 .Nd an RFC 2131 compliant DHCP client
 .Sh SYNOPSIS
 .Nm
-.Op Fl dknpqADEGKLSTV
+.Op Fl dknpqADEGLSTXV
 .Op Fl c , -script Ar script
 .Op Fl f , -config Ar file
 .Op Fl h , -hostname Ar hostname
@@ -324,7 +324,7 @@ Matches full name, or prefixed with 2 numbers optionally ending with
 .Pp
 So to stop dhcpcd from touching your DNS or MTU settings you would do:-
 .D1 dhcpcd -C resolv.conf -C mtu eth0
-.It Fl K , -nodaemonise
+.It Fl X , -nodaemonise
 Don't daemonise when we acquire a lease.
 This disables the
 .Fl t, -timeout
index 26aa2501b5b614739ae849919df6229c98186a90..6d030291d4849b83b8d37501ef33366f88ad294b 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -52,7 +52,7 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define OPTS "c:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:KLO:TV"
+#define OPTS "c:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:LO:TVX"
 
 static int doversion = 0;
 static int dohelp = 0;
@@ -82,15 +82,15 @@ static const struct option longopts[] = {
        {"fqdn",        optional_argument,  NULL, 'F'},
        {"nogateway",   no_argument,        NULL, 'G'},
        {"clientid",    optional_argument,  NULL, 'I'},
-       {"nodaemonise", no_argument,        NULL, 'K'},
        {"noipv4ll",    no_argument,        NULL, 'L'},
        {"nooption",    optional_argument,  NULL, 'O'},
        {"test",        no_argument,        NULL, 'T'},
        {"variables",   no_argument,        NULL, 'V'},
+       {"nodaemonise", no_argument,        NULL, 'X'},
        {"help",        no_argument,        &dohelp, 1},
        {"version",     no_argument,        &doversion, 1},
 #ifdef THERE_IS_NO_FORK
-       {"daemonised",  no_argument,        NULL, 'X'},
+       {"daemonised",  no_argument,        NULL, 'z'},
        {"skiproutes",  required_argument,  NULL, 'Z'},
 #endif
 #ifdef CMDLINE_COMPAT
@@ -109,7 +109,7 @@ char dhcpcd[PATH_MAX];
 char **dhcpcd_argv = NULL;
 int dhcpcd_argc = 0;
 char *dhcpcd_skiproutes = NULL;
-#define EXTRA_OPTS "XZ:"
+#define EXTRA_OPTS "zZ:"
 #endif
 
 #ifdef CMDLINE_COMPAT
@@ -539,12 +539,20 @@ parse_option(int opt, char *oarg, struct options *options)
                }
 #endif
                break;
-       case 'K':
-               options->options &= ~DHCPCD_DAEMONISE;
-               break;
        case 'L':
                options->options &= ~DHCPCD_IPV4LL;
                break;
+       case 'O':
+               if (make_reqmask(options->reqmask, &optarg, -1) != 0 ||
+                   make_reqmask(options->nomask, &optarg, 1) != 0)
+               {
+                       logger(LOG_ERR, "unknown option `%s'", optarg);
+                       return -1;
+               }
+               break;
+       case 'Z':
+               options->options &= ~DHCPCD_DAEMONISE;
+               break;
        default:
                return 0;
        }
@@ -783,7 +791,7 @@ main(int argc, char **argv)
                case 'f':
                        break;
 #ifdef THERE_IS_NO_FORK
-               case 'X':
+               case 'z':
                        options->options |= DHCPCD_DAEMONISED;
                        close_fds();
                        break;
@@ -800,16 +808,6 @@ main(int argc, char **argv)
                case 'x':
                        sig = SIGTERM;
                        break;
-               case 'O':
-                       if (make_reqmask(options->reqmask, &optarg, -1) != 0) {
-                               logger(LOG_ERR, "unknown option `%s'", optarg);
-                               return -1;
-                       }
-                       if (make_reqmask(options->nomask, &optarg, 1) != 0) {
-                               logger(LOG_ERR, "unknown option `%s'", optarg);
-                               return -1;
-                       }
-                       break;
                case 'T':
                        options->options |= DHCPCD_TEST | DHCPCD_PERSISTENT;
                        break;