[hackers] [ubase] Allow to specify the rtc devnode for hwclock(8) || sin

From: <git_AT_suckless.org>
Date: Tue, 03 Jun 2014 17:09:25 +0200

commit 5bbc67aa96b094c1f8edbf6e67ccf64cded7fc3d
Author: sin <sin_AT_2f30.org>
Date: Tue Jun 3 16:04:53 2014 +0100

    Allow to specify the rtc devnode for hwclock(8)

diff --git a/hwclock.c b/hwclock.c
index a259a98..b48d46c 100644
--- a/hwclock.c
+++ b/hwclock.c
_AT_@ -21,7 +21,7 @@ static void systohc(char *);
 static void
 usage(void)
 {
- eprintf("usage: %s [-rsw] [-u]
", argv0);
+ eprintf("usage: %s [-rsw] [-u] [dev]
", argv0);
 }
 
 int
_AT_@ -48,6 +48,11 @@ main(int argc, char *argv[])
                 usage();
         } ARGEND;
 
+ if (argc > 1)
+ usage();
+ else if (argc == 1)
+ dev = argv[0];
+
         if ((rflag ^ sflag ^ wflag) == 0)
                 eprintf("missing or incompatible function
");
 
Received on Tue Jun 03 2014 - 17:09:25 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 03 2014 - 17:12:08 CEST