"I will always compile before I commit."
"I will always compile before I commit." "I will always compile before I commit." -Erik
This commit is contained in:
parent
e5aef92e22
commit
a683ee81d9
@ -371,5 +371,5 @@ const struct BB_applet applets[] = {
|
||||
};
|
||||
|
||||
/* The -1 arises because of the {0,NULL,0,NULL} entry above. */
|
||||
#define NUM_APPLETS (sizeof (applets) / sizeof (struct BB_applet) - 1)
|
||||
size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
|
||||
|
||||
|
@ -108,6 +108,9 @@ struct BB_applet {
|
||||
/* From busybox.c */
|
||||
extern const struct BB_applet applets[];
|
||||
|
||||
extern size_t NUM_APPLETS;
|
||||
|
||||
|
||||
extern int applet_name_compare(const void *x, const void *y);
|
||||
|
||||
extern int ar_main(int argc, char **argv);
|
||||
|
@ -160,26 +160,27 @@ int date_main(int argc, char **argv)
|
||||
/* Interpret command line args */
|
||||
while ((c = getopt(argc, argv, "Rs:ud:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'R':
|
||||
rfc822 = 1;
|
||||
break;
|
||||
case 's':
|
||||
set_time = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
case 'R':
|
||||
rfc822 = 1;
|
||||
break;
|
||||
case 's':
|
||||
set_time = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
|
||||
usage(date_usage);
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
break;
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
usage(date_usage);
|
||||
break;
|
||||
default:
|
||||
usage(date_usage);
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
break;
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
usage(date_usage);
|
||||
break;
|
||||
default:
|
||||
usage(date_usage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,9 +189,13 @@ int date_main(int argc, char **argv)
|
||||
else if (date_str == NULL) {
|
||||
set_time = 1;
|
||||
date_str = argv[optind];
|
||||
} else {
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
errorMsg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt);
|
||||
usage(date_usage);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now we have parsed all the information except the date format
|
||||
which depends on whether the clock is being set or read */
|
||||
@ -217,11 +222,15 @@ int date_main(int argc, char **argv)
|
||||
tm = mktime(&tm_time);
|
||||
if (tm < 0)
|
||||
fatalError(invalid_date, date_str);
|
||||
if ( utc ) {
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
}
|
||||
|
||||
/* if setting time, set it */
|
||||
if (set_time) {
|
||||
if (stime(&tm) < 0) {
|
||||
fatalError("can't set date.\n");
|
||||
perrorMsg("cannot set date");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
51
date.c
51
date.c
@ -160,26 +160,27 @@ int date_main(int argc, char **argv)
|
||||
/* Interpret command line args */
|
||||
while ((c = getopt(argc, argv, "Rs:ud:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'R':
|
||||
rfc822 = 1;
|
||||
break;
|
||||
case 's':
|
||||
set_time = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
case 'R':
|
||||
rfc822 = 1;
|
||||
break;
|
||||
case 's':
|
||||
set_time = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
|
||||
usage(date_usage);
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
break;
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
usage(date_usage);
|
||||
break;
|
||||
default:
|
||||
usage(date_usage);
|
||||
break;
|
||||
case 'u':
|
||||
utc = 1;
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
break;
|
||||
case 'd':
|
||||
use_arg = 1;
|
||||
if ((date_str != NULL) || ((date_str = optarg) == NULL))
|
||||
usage(date_usage);
|
||||
break;
|
||||
default:
|
||||
usage(date_usage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,9 +189,13 @@ int date_main(int argc, char **argv)
|
||||
else if (date_str == NULL) {
|
||||
set_time = 1;
|
||||
date_str = argv[optind];
|
||||
} else {
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
errorMsg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt);
|
||||
usage(date_usage);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now we have parsed all the information except the date format
|
||||
which depends on whether the clock is being set or read */
|
||||
@ -217,11 +222,15 @@ int date_main(int argc, char **argv)
|
||||
tm = mktime(&tm_time);
|
||||
if (tm < 0)
|
||||
fatalError(invalid_date, date_str);
|
||||
if ( utc ) {
|
||||
if (putenv("TZ=UTC0") != 0)
|
||||
fatalError(memory_exhausted);
|
||||
}
|
||||
|
||||
/* if setting time, set it */
|
||||
if (set_time) {
|
||||
if (stime(&tm) < 0) {
|
||||
fatalError("can't set date.\n");
|
||||
perrorMsg("cannot set date");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -371,5 +371,5 @@ const struct BB_applet applets[] = {
|
||||
};
|
||||
|
||||
/* The -1 arises because of the {0,NULL,0,NULL} entry above. */
|
||||
#define NUM_APPLETS (sizeof (applets) / sizeof (struct BB_applet) - 1)
|
||||
size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1);
|
||||
|
||||
|
@ -108,6 +108,9 @@ struct BB_applet {
|
||||
/* From busybox.c */
|
||||
extern const struct BB_applet applets[];
|
||||
|
||||
extern size_t NUM_APPLETS;
|
||||
|
||||
|
||||
extern int applet_name_compare(const void *x, const void *y);
|
||||
|
||||
extern int ar_main(int argc, char **argv);
|
||||
|
2
lash.c
2
lash.c
@ -1152,7 +1152,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int
|
||||
int pipefds[2]; /* pipefd[0] is for reading */
|
||||
struct builtInCommand *x;
|
||||
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
struct BB_applet search_applet, *applet = applets;
|
||||
struct BB_applet search_applet, *applet;
|
||||
#endif
|
||||
|
||||
nextin = 0, nextout = 1;
|
||||
|
2
sh.c
2
sh.c
@ -1152,7 +1152,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int
|
||||
int pipefds[2]; /* pipefd[0] is for reading */
|
||||
struct builtInCommand *x;
|
||||
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
struct BB_applet search_applet, *applet = applets;
|
||||
struct BB_applet search_applet, *applet;
|
||||
#endif
|
||||
|
||||
nextin = 0, nextout = 1;
|
||||
|
@ -1152,7 +1152,7 @@ static int runCommand(struct job *newJob, struct jobSet *jobList, int inBg, int
|
||||
int pipefds[2]; /* pipefd[0] is for reading */
|
||||
struct builtInCommand *x;
|
||||
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
|
||||
struct BB_applet search_applet, *applet = applets;
|
||||
struct BB_applet search_applet, *applet;
|
||||
#endif
|
||||
|
||||
nextin = 0, nextout = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user