summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-06-11 12:57:29 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2012-06-11 12:57:29 (GMT)
commit39f82d4309633815160a291bbf9fa83c21fb4a17 (patch)
tree1f15cf516e380b70262b0ca5693340627bc105f3
parent0ccae4d8b379d310213a4e911670070b7030482d (diff)
downloadbusybox-39f82d4309633815160a291bbf9fa83c21fb4a17.tar.gz
busybox-39f82d4309633815160a291bbf9fa83c21fb4a17.tar.bz2
rdate: code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/rdate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 2ca585f..6e35cd5 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -61,7 +61,7 @@ int rdate_main(int argc UNUSED_PARAM, char **argv)
remote_time = askremotedate(argv[optind]);
- if (!(flags & 2)) {
+ if (!(flags & 2)) { /* no -p (-s may be present) */
time_t current_time;
time(&current_time);
@@ -72,7 +72,7 @@ int rdate_main(int argc UNUSED_PARAM, char **argv)
bb_perror_msg_and_die("can't set time of day");
}
- if ((flags & 2) || !(flags & 1))
+ if (flags != 1) /* not lone -s */
printf("%s", ctime(&remote_time));
return EXIT_SUCCESS;