Various cleanups I made while going through Erik Hovland's patch submissions,
[oweals/busybox.git] / networking / udhcp / dumpleases.c
index 4c1ee131f01ffb9910705d3a7f4822e38996e6f5..08a22f17d2fa7ac668065eee5fbdef6d20f21f46 100644 (file)
@@ -1,3 +1,7 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ */
 #include <fcntl.h>
 #include <string.h>
 #include <stdlib.h>
@@ -12,6 +16,7 @@
 #include <getopt.h>
 #include <time.h>
 
+#include "dhcpd.h"
 #include "leases.h"
 #include "libbb_udhcp.h"
 
 
 
 #ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) show_usage(void)
+static void ATTRIBUTE_NORETURN show_usage(void)
 {
        printf(
 "Usage: dumpleases -f <file> -[r|a]\n\n"
 "  -f, --file=FILENAME             Leases file to load\n"
-"  -r, --remaining                 Interepret lease times as time remaing\n"
+"  -r, --remaining                 Interepret lease times as time remaining\n"
 "  -a, --absolute                  Interepret lease times as expire time\n");
        exit(0);
 }
@@ -46,7 +51,7 @@ int main(int argc, char *argv[])
        const char *file = LEASES_FILE;
        struct dhcpOfferedAddr lease;
        struct in_addr addr;
-       
+
        static const struct option options[] = {
                {"absolute", 0, 0, 'a'},
                {"remaining", 0, 0, 'r'},
@@ -58,7 +63,7 @@ int main(int argc, char *argv[])
                int option_index = 0;
                c = getopt_long(argc, argv, "arf:", options, &option_index);
                if (c == -1) break;
-               
+
                switch (c) {
                case 'a': mode = ABSOLUTE; break;
                case 'r': mode = REMAINING; break;
@@ -69,10 +74,10 @@ int main(int argc, char *argv[])
                        show_usage();
                }
        }
-                       
+
        fp = xfopen(file, "r");
 
-       printf("Mac Address       IP-Address      Expires %s\n", mode == REMAINING ? "in" : "at");  
+       printf("Mac Address       IP-Address      Expires %s\n", mode == REMAINING ? "in" : "at");
        /*     "00:00:00:00:00:00 255.255.255.255 Wed Jun 30 21:49:08 1993" */
        while (fread(&lease, sizeof(lease), 1, fp)) {
 
@@ -104,6 +109,6 @@ int main(int argc, char *argv[])
                } else printf("%s", ctime(&expires));
        }
        fclose(fp);
-       
+
        return 0;
 }