diff options
-rw-r--r-- | util-linux/rdate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 27bd1b481..c740a691e 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
@@ -68,7 +68,7 @@ int rdate_main(int argc, char **argv) | |||
68 | 68 | ||
69 | remote_time = askremotedate(argv[optind]); | 69 | remote_time = askremotedate(argv[optind]); |
70 | 70 | ||
71 | if (flags & 1) { | 71 | if ((flags & 2) == 0) { |
72 | time_t current_time; | 72 | time_t current_time; |
73 | 73 | ||
74 | time(¤t_time); | 74 | time(¤t_time); |
@@ -77,10 +77,10 @@ int rdate_main(int argc, char **argv) | |||
77 | else | 77 | else |
78 | if (stime(&remote_time) < 0) | 78 | if (stime(&remote_time) < 0) |
79 | bb_perror_msg_and_die("Could not set time of day"); | 79 | bb_perror_msg_and_die("Could not set time of day"); |
80 | } | ||
80 | 81 | ||
81 | /* No need to check for the -p flag as it's the only option left */ | 82 | if ((flags & 1) == 0) |
82 | 83 | printf("%s", ctime(&remote_time)); | |
83 | } else printf("%s", ctime(&remote_time)); | ||
84 | 84 | ||
85 | return EXIT_SUCCESS; | 85 | return EXIT_SUCCESS; |
86 | } | 86 | } |