← Commit list

570f655ee

Rob Landley
Rob Landley
2005-09-14
SOURCE BUG Duration: 5s

Subject

Cleanup patch from tito: migrate option parsing to the bb_ functions and fix types.

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

sysklogd/klogd.c+12 -25
@@ -113,37 +113,24 @@ static void doKlogd(const int console_log_level)
}
}
+#define OPT_LEVEL 1
+#define OPT_FOREGROUND 2
+
extern int klogd_main(int argc, char **argv)
{
- /* no options, no getopt */
- int opt;
- int doFork = TRUE;
- unsigned char console_log_level = -1;
+ unsigned long opt;
+ char *c_arg;
+ int console_log_level = -1;
/* do normal option parsing */
- while ((opt = getopt(argc, argv, "c:n")) > 0) {
- switch (opt) {
- case 'c':
- if ((optarg == NULL) || (optarg[1] != '\0')) {
- bb_show_usage();
- }
- /* Valid levels are between 1 and 8 */
- console_log_level = *optarg - '1';
- if (console_log_level > 7) {
- bb_show_usage();
- }
- console_log_level++;
-
- break;
- case 'n':
- doFork = FALSE;
- break;
- default:
- bb_show_usage();
- }
+ opt = bb_getopt_ulflags (argc, argv, "c:n", &c_arg);
+
+ if (opt & OPT_LEVEL) {
+ /* Valid levels are between 1 and 8 */
+ console_log_level = bb_xgetlarg(c_arg, 10, 1, 8);
}
- if (doFork) {
+ if (!(opt & OPT_FOREGROUND)) {
#if defined(__uClinux__)
vfork_daemon_rexec(0, 1, argc, argv, "-n");
#else /* __uClinux__ */