]> err.no Git - util-linux/commitdiff
hwclock: unshadow a diagnostic printf
authorKalev Soikonen <ksop@hot.ee>
Sun, 27 Jul 2008 23:13:53 +0000 (02:13 +0300)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Aug 2008 10:28:17 +0000 (12:28 +0200)
- Bogus if test means one message is never produced.

- Avoid needless passing of a global variable (debug).

The --test option flag ought to be a global as well (and perhaps -n/--dry-run).

Signed-off-by: Kalev Soikonen <ksop@hot.ee>
hwclock/hwclock.c

index 6660a09a8ece7e0a79400d4069acecdd57af6611..3841276fd2f1aa60cbe96f68a1902f5b6caf996b 100644 (file)
@@ -847,8 +847,7 @@ calculate_adjustment(const double factor,
                      const double not_adjusted,
                      const time_t systime,
                      int *adjustment_p,
-                     double *retro_p,
-                     const int debug ) {
+                     double *retro_p) {
 /*----------------------------------------------------------------------------
   Do the drift adjustment calculation.
 
@@ -988,8 +987,7 @@ do_adjustment(struct adjtime *adjtime_p,
                          adjtime_p->last_adj_time,
                          adjtime_p->not_adjusted,
                          hclocktime,
-                         &adjustment, &retro,
-                         debug );
+                         &adjustment, &retro);
     if (adjustment > 0 || adjustment < -1) {
       set_hardware_clock_exact(hclocktime + adjustment,
                                time_inc(read_time, -retro),
@@ -1504,7 +1502,7 @@ main(int argc, char **argv) {
                permitted = TRUE;
        else {
                /* program is designed to run setuid (in some situations) */
-               if (set || hctosys || systohc || adjust) {
+               if (set || systohc || adjust) {
                        fprintf(stderr,
                                _("Sorry, only the superuser can change "
                                  "the Hardware Clock.\n"));