[git commit] rdate: time(NULL) is shorter than time(&var)

Denys Vlasenko vda.linux at googlemail.com
Fri Jan 20 15:07:14 UTC 2017


commit: https://git.busybox.net/busybox/commit/?id=6e511393f90a30c93c445c3d1ed6090e79e7384b
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
rdate_main                                           251     246      -5

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/rdate.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index a625919..960df25 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -95,10 +95,7 @@ int rdate_main(int argc UNUSED_PARAM, char **argv)
 	 */
 
 	if (!(flags & 2)) { /* no -p (-s may be present) */
-		time_t current_time;
-
-		time(&current_time);
-		if (current_time == remote_time)
+		if (time(NULL) == remote_time)
 			bb_error_msg("current time matches remote time");
 		else
 			if (stime(&remote_time) < 0)


More information about the busybox-cvs mailing list