*
*/
-#include "busybox.h"
-#define BB_DECLARE_EXTERN
-#include "messages.c"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <getopt.h>
+#include <string.h>
+#include <time.h>
#include <stdlib.h>
#include <unistd.h>
+#include "busybox.h"
+#define BB_DECLARE_EXTERN
+#include "messages.c"
static const int RFC_868_BIAS = 2208988800UL;
-int setdate= 0;
-int printdate= 0;
+static int setdate= 0;
+static int printdate= 0;
-time_t askremotedate(char *host)
+static time_t askremotedate(char *host)
{
struct hostent *h;
struct sockaddr_in sin;
/* Interpret command line args */
/* do special-case option parsing */
if (argv[1] && (strcmp(argv[1], "--help") == 0))
- usage(rdate_usage);
+ show_usage();
/* do normal option parsing */
while ((opt = getopt(argc, argv, "Hsp")) > 0) {
switch (opt) {
default:
case 'H':
- usage(rdate_usage);
+ show_usage();
break;
case 's':
setdate++;
if (printdate==0 && setdate==0) setdate++;
if (optind == argc) {
- usage(rdate_usage);
+ show_usage();
}
if ((time= askremotedate(argv[optind])) == (time_t)-1) {