aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-03 10:24:20 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-03 10:24:20 +0000
commit6a395904343d959e24a4c0420b572c450d5a0d8c (patch)
tree77f6caaf2ce4bde7067e4a85ca9488991a04c86c
parente1bbdd96eb64e5608682fac700d30b48f18aea2f (diff)
downloadbusybox-w32-6a395904343d959e24a4c0420b572c450d5a0d8c.tar.gz
busybox-w32-6a395904343d959e24a4c0420b572c450d5a0d8c.tar.bz2
busybox-w32-6a395904343d959e24a4c0420b572c450d5a0d8c.zip
- No options should set the current system time.
Shaun Jackman writes: A bug introduced in svn 11946 broke rdate. It no longer sets the current system time when no options are specified. The options have the opposite sense from what one might think, and, oddly enough, -ps is intentionally a no-op. Quoth rdate(8) from the BSD System Manager's Manual: -p Do not set, just print the remote time -s Do not print the time. git-svn-id: svn://busybox.net/trunk/busybox@15269 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--util-linux/rdate.c8
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(&current_time); 74 time(&current_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}