diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-20 16:07:14 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-20 16:07:14 +0100 |
| commit | 6e511393f90a30c93c445c3d1ed6090e79e7384b (patch) | |
| tree | 11374f651fad09fbb36500cd94c7bdb607431ef3 /util-linux | |
| parent | 179e88bec91cfe58096900dc5509a080ff37b083 (diff) | |
| download | busybox-w32-6e511393f90a30c93c445c3d1ed6090e79e7384b.tar.gz busybox-w32-6e511393f90a30c93c445c3d1ed6090e79e7384b.tar.bz2 busybox-w32-6e511393f90a30c93c445c3d1ed6090e79e7384b.zip | |
rdate: time(NULL) is shorter than time(&var)
function old new delta
rdate_main 251 246 -5
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
| -rw-r--r-- | util-linux/rdate.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index a62591914..960df25d2 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c | |||
| @@ -95,10 +95,7 @@ int rdate_main(int argc UNUSED_PARAM, char **argv) | |||
| 95 | */ | 95 | */ |
| 96 | 96 | ||
| 97 | if (!(flags & 2)) { /* no -p (-s may be present) */ | 97 | if (!(flags & 2)) { /* no -p (-s may be present) */ |
| 98 | time_t current_time; | 98 | if (time(NULL) == remote_time) |
| 99 | |||
| 100 | time(¤t_time); | ||
| 101 | if (current_time == remote_time) | ||
| 102 | bb_error_msg("current time matches remote time"); | 99 | bb_error_msg("current time matches remote time"); |
| 103 | else | 100 | else |
| 104 | if (stime(&remote_time) < 0) | 101 | if (stime(&remote_time) < 0) |
