1303 files changed, 32187 insertions, 57138 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c index 6e35cd5..51d5eb6 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -6,16 +6,30 @@ * by Sterling Huxley <sterling@europa.com> * * Licensed under GPLv2 or later, see file LICENSE in this source tree. -*/ + */ +//config:config RDATE +//config: bool "rdate" +//config: default y +//config: help +//config: The rdate utility allows you to synchronize the date and time of your +//config: system clock with the date and time of a remote networked system using +//config: the RFC868 protocol, which is built into the inetd daemon on most +//config: systems. + +//applet:IF_RDATE(APPLET(rdate, BB_DIR_USR_SBIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_RDATE) += rdate.o //usage:#define rdate_trivial_usage //usage: "[-sp] HOST" //usage:#define rdate_full_usage "\n\n" -//usage: "Get and possibly set the system date/time from a remote HOST\n" -//usage: "\n -s Set the system date/time (default)" -//usage: "\n -p Print the date/time" +//usage: "Get and possibly set system time from a remote HOST\n" +//usage: "\n -s Set system time (default)" +//usage: "\n -p Print time" #include "libbb.h" +#include <android.h> + enum { RFC_868_BIAS = 2208988800UL }; @@ -36,7 +50,7 @@ static time_t askremotedate(const char *host) fd = create_and_connect_stream_or_die(host, bb_lookup_port("time", "tcp", 37)); if (safe_read(fd, &nett, 4) != 4) /* read time from server */ - bb_error_msg_and_die("%s did not send the complete time", host); + bb_error_msg_and_die("%s: %s", host, "short read"); if (ENABLE_FEATURE_CLEAN_UP) close(fd); |