From 12677acf0a0bda4a863279ece65eccda6c36d6b1 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Mon, 10 Dec 2012 14:49:39 -0500 Subject: CONFIG_PID_FILE_PATH: new configuration option for pidfile paths We set a default path for the directory where pidfiles are create when FEATURE_PIDFILE is selected. The default has no effect on applets which must specify a pidfile path on the command line to run, and it can be overridden by applets which optionally allow the user to specify the pidfile path. We also add pidfile write/remove support for klogd, ntpd and watchdog. For syslogd, we add a missing remove_pidfile() for better cleanup on daemon exit. Signed-off-by: Anthony G. Basile Signed-off-by: Mike Frysinger --- miscutils/crond.c | 2 +- miscutils/watchdog.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'miscutils') diff --git a/miscutils/crond.c b/miscutils/crond.c index a0b73c774..582dc991a 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -885,7 +885,7 @@ int crond_main(int argc UNUSED_PARAM, char **argv) xsetenv("SHELL", DEFAULT_SHELL); /* once, for all future children */ crondlog(LVL8 "crond (busybox "BB_VER") started, log level %d", G.log_level); rescan_crontab_dir(); - write_pidfile("/var/run/crond.pid"); + write_pidfile(CONFIG_PID_FILE_PATH "/crond.pid"); /* Main loop */ t2 = time(NULL); diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index ee28dc30d..d3a76edf0 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c @@ -31,6 +31,7 @@ static void watchdog_shutdown(int sig UNUSED_PARAM) { static const char V = 'V'; + remove_pidfile(CONFIG_PID_FILE_PATH "/watchdog.pid"); write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ if (ENABLE_FEATURE_CLEAN_UP) close(3); @@ -95,6 +96,8 @@ int watchdog_main(int argc, char **argv) stimer_duration, htimer_duration * 1000); #endif + write_pidfile(CONFIG_PID_FILE_PATH "/watchdog.pid"); + while (1) { /* * Make sure we clear the counter before sleeping, -- cgit v1.2.3-55-g6feb From 6967578728a3eef43b7b2be4080dafc1b87f528d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Jan 2013 01:34:48 +0100 Subject: whitespace fixes. no code changes Signed-off-by: Denys Vlasenko --- archival/dpkg.c | 6 +- archival/gzip.c | 16 +-- archival/lzop.c | 2 +- archival/tar.c | 14 +-- console-tools/setlogcons.c | 7 +- coreutils/cal.c | 4 +- coreutils/cut.c | 2 +- coreutils/df.c | 4 +- coreutils/id.c | 2 +- coreutils/ls.c | 4 +- coreutils/md5_sha1_sum.c | 2 +- e2fsprogs/fsck.c | 4 +- findutils/find.c | 4 +- miscutils/fbsplash.c | 2 +- miscutils/last.c | 4 +- modutils/depmod.c | 6 +- networking/arp.c | 14 +-- networking/ether-wake.c | 6 +- networking/httpd.c | 6 +- networking/httpd_ssi.c | 2 +- networking/ifconfig.c | 2 +- networking/interface.c | 29 +++-- networking/nc.c | 2 +- networking/ntpd.c | 11 +- networking/ntpd_simple.c | 2 +- networking/ping.c | 2 +- networking/route.c | 14 +-- procps/powertop.c | 2 +- procps/sysctl.c | 2 +- sysklogd/syslogd.c | 2 +- util-linux/fdformat.c | 2 +- util-linux/fdisk.c | 2 +- util-linux/flock.c | 2 +- util-linux/ipcrm.c | 6 +- util-linux/ipcs.c | 254 +++++++++++++++++++------------------- util-linux/lspci.c | 6 +- util-linux/mount.c | 48 +++---- util-linux/readprofile.c | 16 +-- util-linux/volume_id/linux_raid.c | 6 +- util-linux/volume_id/util.c | 2 +- 40 files changed, 261 insertions(+), 262 deletions(-) (limited to 'miscutils') diff --git a/archival/dpkg.c b/archival/dpkg.c index dae8a9747..ed86f3355 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c @@ -1026,8 +1026,8 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count if (package_edge->type == EDGE_CONFLICTS) { const unsigned package_num = search_package_hashtable(package_edge->name, - package_edge->version, - package_edge->operator); + package_edge->version, + package_edge->operator); int result = 0; if (package_hashtable[package_num] != NULL) { status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]); @@ -1114,7 +1114,7 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count */ if (root_of_alternatives && package_edge->type != root_of_alternatives->type - 1) bb_error_msg_and_die("fatal error, package dependencies corrupt: %d != %d - 1", - package_edge->type, root_of_alternatives->type); + package_edge->type, root_of_alternatives->type); if (package_hashtable[package_num] != NULL) result = !package_satisfies_dependency(package_num, package_edge->type); diff --git a/archival/gzip.c b/archival/gzip.c index 80db4f969..31ccab3cd 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -1179,7 +1179,7 @@ static void gen_codes(ct_data * tree, int max_code) * must be all ones. */ Assert(code + G2.bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1, - "inconsistent bit counts"); + "inconsistent bit counts"); Tracev((stderr, "\ngen_codes: max_code %d ", max_code)); for (n = 0; n <= max_code; n++) { @@ -1527,9 +1527,9 @@ static int ct_tally(int dist, int lc) } out_length >>= 3; Trace((stderr, - "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ", - G2.last_lit, G2.last_dist, in_length, out_length, - 100L - out_length * 100L / in_length)); + "\nlast_lit %u, last_dist %u, in %ld, out ~%ld(%ld%%) ", + G2.last_lit, G2.last_dist, in_length, out_length, + 100L - out_length * 100L / in_length)); if (G2.last_dist < G2.last_lit / 2 && out_length < in_length / 2) return 1; } @@ -1621,9 +1621,9 @@ static ulg flush_block(char *buf, ulg stored_len, int eof) static_lenb = (G2.static_len + 3 + 7) >> 3; Trace((stderr, - "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ", - opt_lenb, G2.opt_len, static_lenb, G2.static_len, stored_len, - G2.last_lit, G2.last_dist)); + "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u ", + opt_lenb, G2.opt_len, static_lenb, G2.static_len, stored_len, + G2.last_lit, G2.last_dist)); if (static_lenb <= opt_lenb) opt_lenb = static_lenb; @@ -1661,7 +1661,7 @@ static ulg flush_block(char *buf, ulg stored_len, int eof) } else { send_bits((DYN_TREES << 1) + eof, 3); send_all_trees(G2.l_desc.max_code + 1, G2.d_desc.max_code + 1, - max_blindex + 1); + max_blindex + 1); compress_block((ct_data *) G2.dyn_ltree, (ct_data *) G2.dyn_dtree); G2.compressed_len += 3 + G2.opt_len; } diff --git a/archival/lzop.c b/archival/lzop.c index fbe08417d..ec4e784ed 100644 --- a/archival/lzop.c +++ b/archival/lzop.c @@ -350,7 +350,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len, // LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b); *out_len = pd(op, out); return (ip == ip_end ? LZO_E_OK : - (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); } /**********************************************************************/ diff --git a/archival/tar.c b/archival/tar.c index a3565d6ae..f46f7bb7a 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -333,13 +333,13 @@ static int writeTarHeader(struct TarBallInfo *tbInfo, && (filesize <= 0x3fffffffffffffffffffffffLL) #endif ) { - /* GNU tar uses "base-256 encoding" for very large numbers. - * Encoding is binary, with highest bit always set as a marker - * and sign in next-highest bit: - * 80 00 .. 00 - zero - * bf ff .. ff - largest positive number - * ff ff .. ff - minus 1 - * c0 00 .. 00 - smallest negative number + /* GNU tar uses "base-256 encoding" for very large numbers. + * Encoding is binary, with highest bit always set as a marker + * and sign in next-highest bit: + * 80 00 .. 00 - zero + * bf ff .. ff - largest positive number + * ff ff .. ff - minus 1 + * c0 00 .. 00 - smallest negative number */ char *p8 = header.size + sizeof(header.size); do { diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c index 83a895407..c76a5a42b 100644 --- a/console-tools/setlogcons.c +++ b/console-tools/setlogcons.c @@ -22,9 +22,10 @@ int setlogcons_main(int argc UNUSED_PARAM, char **argv) struct { char fn; char subarg; - } arg = { 11, /* redirect kernel messages */ - 0 /* to specified console (current as default) */ - }; + } arg = { + 11, /* redirect kernel messages */ + 0 /* to specified console (current as default) */ + }; if (argv[1]) arg.subarg = xatou_range(argv[1], 0, 63); diff --git a/coreutils/cal.c b/coreutils/cal.c index b470ad968..158b23fbc 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c @@ -167,8 +167,8 @@ int cal_main(int argc UNUSED_PARAM, char **argv) day_array(month, year, dp); len = sprintf(lineout, "%s %d", month_names[month - 1], year); printf("%*s%s\n%s\n", - ((7*julian + WEEK_LEN) - len) / 2, "", - lineout, day_headings); + ((7*julian + WEEK_LEN) - len) / 2, "", + lineout, day_headings); for (row = 0; row < 6; row++) { build_row(lineout, dp)[0] = '\0'; dp += 7; diff --git a/coreutils/cut.c b/coreutils/cut.c index 2c27b704f..84449c775 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -212,7 +212,7 @@ int cut_main(int argc UNUSED_PARAM, char **argv) if (opt & CUT_OPT_SUPPRESS_FLGS) { bb_error_msg_and_die ("suppressing non-delimited lines makes sense%s", - _op_on_field); + _op_on_field); } if (delim != '\t') { bb_error_msg_and_die diff --git a/coreutils/df.c b/coreutils/df.c index 63dbd61bd..2c72e82a4 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -112,7 +112,7 @@ int df_main(int argc UNUSED_PARAM, char **argv) /* From the manpage of df from coreutils-6.10: Disk space is shown in 1K blocks by default, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. - */ + */ if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ df_disp_hr = 512; @@ -221,7 +221,7 @@ int df_main(int argc UNUSED_PARAM, char **argv) } #else if (printf("\n%-20s" + 1, device) > 20 && !(opt & OPT_POSIX)) - printf("\n%-20s", ""); + printf("\n%-20s", ""); #endif #if ENABLE_FEATURE_HUMAN_READABLE diff --git a/coreutils/id.c b/coreutils/id.c index 399d25e34..1f20b755e 100644 --- a/coreutils/id.c +++ b/coreutils/id.c @@ -174,7 +174,7 @@ int id_main(int argc UNUSED_PARAM, char **argv) /* Don't allow -n -r -nr -ug -rug -nug -rnug -uZ -gZ -GZ*/ /* Don't allow more than one username */ opt_complementary = "?1:u--g:g--u:G--u:u--G:g--G:G--g:r?ugG:n?ugG" - IF_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G"); + IF_SELINUX(":u--Z:Z--u:g--Z:Z--g:G--Z:Z--G"); opt = getopt32(argv, "rnugG" IF_SELINUX("Z")); } diff --git a/coreutils/ls.c b/coreutils/ls.c index d5b25ee70..166473d4d 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -260,7 +260,7 @@ enum { /* TODO: simple toggles may be stored as OPT_xxx bits instead */ static const uint32_t opt_flags[] = { - STYLE_COLUMNAR, /* C */ + STYLE_COLUMNAR, /* C */ DISP_HIDDEN | DISP_DOT, /* a */ DISP_NOLIST, /* d */ LIST_INO, /* i */ @@ -720,7 +720,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f if ((option_mask32 & OPT_L) || force_follow) { #if ENABLE_SELINUX if (is_selinux_enabled()) { - getfilecon(fullname, &cur->sid); + getfilecon(fullname, &cur->sid); } #endif if (stat(fullname, &statbuf)) { diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c index 2cb6dd43c..59b520fce 100644 --- a/coreutils/md5_sha1_sum.c +++ b/coreutils/md5_sha1_sum.c @@ -223,7 +223,7 @@ int md5_sha1_sum_main(int argc UNUSED_PARAM, char **argv) } if (count_failed && !(flags & FLAG_SILENT)) { bb_error_msg("WARNING: %d of %d computed checksums did NOT match", - count_failed, count_total); + count_failed, count_total); } fclose_if_not_stdin(pre_computed_stream); } else { diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 4b2f774f5..d32f396e9 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c @@ -478,7 +478,7 @@ static int wait_one(int flags) instance_list = inst->next; if (verbose > 1) printf("Finished with %s (exit status %d)\n", - inst->device, status); + inst->device, status); num_running--; free_instance(inst); @@ -844,7 +844,7 @@ static int check_all(void) if (verbose > 1) printf("--waiting-- (pass %d)\n", passno); status |= wait_many(pass_done ? FLAG_WAIT_ALL : - FLAG_WAIT_ATLEAST_ONE); + FLAG_WAIT_ATLEAST_ONE); if (pass_done) { if (verbose > 1) puts("----------------------------------"); diff --git a/findutils/find.c b/findutils/find.c index b521e5b08..2235b5049 100644 --- a/findutils/find.c +++ b/findutils/find.c @@ -878,8 +878,8 @@ static action*** parse_params(char **argv) IF_FEATURE_FIND_EXEC( "-exec\0" ) IF_FEATURE_FIND_PAREN( "(\0" ) /* All options/actions starting from here require argument */ - "-name\0" - "-iname\0" + "-name\0" + "-iname\0" IF_FEATURE_FIND_PATH( "-path\0" ) #if ENABLE_DESKTOP IF_FEATURE_FIND_PATH( "-wholename\0") diff --git a/miscutils/fbsplash.c b/miscutils/fbsplash.c index 05a77da23..12a77b70f 100644 --- a/miscutils/fbsplash.c +++ b/miscutils/fbsplash.c @@ -150,7 +150,7 @@ static void fb_open(const char *strfb_device) // map the device in memory G.addr = mmap(NULL, - G.scr_var.yres * G.scr_fix.line_length, + G.scr_var.yres * G.scr_fix.line_length, PROT_WRITE, MAP_SHARED, fbfd, 0); if (G.addr == MAP_FAILED) bb_perror_msg_and_die("mmap"); diff --git a/miscutils/last.c b/miscutils/last.c index d52780374..24f6e1c78 100644 --- a/miscutils/last.c +++ b/miscutils/last.c @@ -71,7 +71,7 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) file = xopen(bb_path_wtmp_file, O_RDONLY); printf("%-10s %-14s %-18s %-12.12s %s\n", - "USER", "TTY", "HOST", "LOGIN", "TIME"); + "USER", "TTY", "HOST", "LOGIN", "TIME"); /* yikes. We reverse over the file and that is a not too elegant way */ pos = xlseek(file, 0, SEEK_END); pos = lseek(file, pos - sizeof(ut), SEEK_SET); @@ -131,7 +131,7 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) * but some systems have it wrong */ t_tmp = (time_t)ut.ut_tv.tv_sec; printf("%-10s %-14s %-18s %-12.12s\n", - ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4); + ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4); next: pos -= sizeof(ut); if (pos <= 0) diff --git a/modutils/depmod.c b/modutils/depmod.c index 775236126..aa228ec85 100644 --- a/modutils/depmod.c +++ b/modutils/depmod.c @@ -31,7 +31,7 @@ typedef struct module_info { } module_info; static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARAM, - void *data, int depth UNUSED_PARAM) + void *data, int depth UNUSED_PARAM) { char modname[MODULE_NAME_LEN]; module_info **first = (module_info **) data; @@ -95,7 +95,7 @@ static module_info *find_module(module_info *modules, const char *modname) } static void order_dep_list(module_info *modules, module_info *start, - llist_t *add) + llist_t *add) { module_info *m; llist_t *n; @@ -216,7 +216,7 @@ int depmod_main(int argc UNUSED_PARAM, char **argv) } while (*++argv); } else { recursive_action(".", ACTION_RECURSE, - parse_module, NULL, &modules, 0); + parse_module, NULL, &modules, 0); } /* Generate dependency and alias files */ diff --git a/networking/arp.c b/networking/arp.c index 696c402e0..1c99987ae 100644 --- a/networking/arp.c +++ b/networking/arp.c @@ -214,7 +214,7 @@ static int arp_del(char **args) /* Get the hardware address to a specified interface name */ static void arp_getdevhw(char *ifname, struct sockaddr *sa, - const struct hwtype *hwt) + const struct hwtype *hwt) { struct ifreq ifr; const struct hwtype *xhw; @@ -233,8 +233,8 @@ static void arp_getdevhw(char *ifname, struct sockaddr *sa, xhw = get_hwntype(-1); } bb_error_msg("device '%s' has HW address %s '%s'", - ifname, xhw->name, - xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data)); + ifname, xhw->name, + xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data)); } } @@ -345,7 +345,7 @@ static int arp_set(char **args) /* Print the contents of an ARP request block. */ static void arp_disp(const char *name, char *ip, int type, int arp_flags, - char *hwa, char *mask, char *dev) + char *hwa, char *mask, char *dev) { static const int arp_masks[] = { ATF_PERM, ATF_PUBL, @@ -428,7 +428,7 @@ static int arp_show(char *name) /* All these strings can't overflow * because fgets above reads limited amount of data */ num = sscanf(line, "%s 0x%x 0x%x %s %s %s\n", - ip, &type, &flags, hwa, mask, dev); + ip, &type, &flags, hwa, mask, dev); if (num < 4) break; @@ -461,7 +461,7 @@ static int arp_show(char *name) } if (option_mask32 & ARP_OPT_v) printf("Entries: %d\tSkipped: %d\tFound: %d\n", - entries, entries - shown, shown); + entries, entries - shown, shown); if (!shown) { if (hw_set || host || device[0]) @@ -517,7 +517,7 @@ int arp_main(int argc UNUSED_PARAM, char **argv) if (hw->alen <= 0) { bb_error_msg_and_die("%s: %s without ARP support", - hw->name, "hardware type"); + hw->name, "hardware type"); } /* Now see what we have to do here... */ diff --git a/networking/ether-wake.c b/networking/ether-wake.c index 6a88279f4..a73b0baea 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -238,9 +238,9 @@ int ether_wake_main(int argc UNUSED_PARAM, char **argv) { unsigned char *hwaddr = if_hwaddr.ifr_hwaddr.sa_data; printf("The hardware address (SIOCGIFHWADDR) of %s is type %d " - "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n\n", ifname, - if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1], - hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); + "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n\n", ifname, + if_hwaddr.ifr_hwaddr.sa_family, hwaddr[0], hwaddr[1], + hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); } # endif } diff --git a/networking/httpd.c b/networking/httpd.c index a942794f5..1934bb27e 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -796,9 +796,9 @@ static void parse_conf(const char *path, int flag) /* the line is not recognized */ config_error: bb_error_msg("config error '%s' in '%s'", buf, filename); - } /* while (fgets) */ + } /* while (fgets) */ - fclose(f); + fclose(f); } #if ENABLE_FEATURE_HTTPD_ENCODE_URL_STR @@ -1708,7 +1708,7 @@ static int pam_talker(int num_msg, case PAM_PROMPT_ECHO_OFF: s = userinfo->pw; break; - case PAM_ERROR_MSG: + case PAM_ERROR_MSG: case PAM_TEXT_INFO: s = ""; break; diff --git a/networking/httpd_ssi.c b/networking/httpd_ssi.c index cfe64eb46..4bd9a6d97 100644 --- a/networking/httpd_ssi.c +++ b/networking/httpd_ssi.c @@ -133,7 +133,7 @@ static void process_includes(const char *filename) process_includes(include_directive); /* Print everything after directive */ - if (end) { + if (end) { fputs(end, stdout); free(end); } diff --git a/networking/ifconfig.c b/networking/ifconfig.c index b6604f5d1..320df3010 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c @@ -449,7 +449,7 @@ int ifconfig_main(int argc UNUSED_PARAM, char **argv) } #endif memcpy( (((char *)&ifr) + a1op->ifr_offset), - p, sizeof(struct sockaddr)); + p, sizeof(struct sockaddr)); } else { /* FIXME: error check?? */ unsigned long i = strtoul(*argv, NULL, 0); diff --git a/networking/interface.c b/networking/interface.c index 79c322ec0..4b9b9485d 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -950,8 +950,8 @@ static void ife_print6(struct interface *ptr) (struct sockaddr *) &sap.sin6_addr); sap.sin6_family = AF_INET6; printf(" inet6 addr: %s/%d", - INET6_sprint((struct sockaddr *) &sap, 1), - plen); + INET6_sprint((struct sockaddr *) &sap, 1), + plen); printf(" Scope:"); switch (scope & IPV6_ADDR_SCOPE_MASK) { case 0: @@ -1019,7 +1019,7 @@ static void ife_print(struct interface *ptr) if (ptr->has_ip) { printf(" %s addr:%s ", ap->name, - ap->sprint(&ptr->addr, 1)); + ap->sprint(&ptr->addr, 1)); if (ptr->flags & IFF_POINTOPOINT) { printf(" P-t-P:%s ", ap->sprint(&ptr->dstaddr, 1)); } @@ -1102,17 +1102,17 @@ static void ife_print(struct interface *ptr) printf(" "); printf("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n", - ptr->stats.rx_packets, ptr->stats.rx_errors, - ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors, - ptr->stats.rx_frame_errors); + ptr->stats.rx_packets, ptr->stats.rx_errors, + ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors, + ptr->stats.rx_frame_errors); if (can_compress) printf(" compressed:%lu\n", - ptr->stats.rx_compressed); + ptr->stats.rx_compressed); printf(" "); printf("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n", - ptr->stats.tx_packets, ptr->stats.tx_errors, - ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, - ptr->stats.tx_carrier_errors); + ptr->stats.tx_packets, ptr->stats.tx_errors, + ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, + ptr->stats.tx_carrier_errors); printf(" collisions:%lu ", ptr->stats.collisions); if (can_compress) printf("compressed:%lu ", ptr->stats.tx_compressed); @@ -1129,13 +1129,12 @@ static void ife_print(struct interface *ptr) printf(" "); if (ptr->map.irq) printf("Interrupt:%d ", ptr->map.irq); - if (ptr->map.base_addr >= 0x100) /* Only print devices using it for - I/O maps */ + if (ptr->map.base_addr >= 0x100) /* Only print devices using it for I/O maps */ printf("Base address:0x%lx ", - (unsigned long) ptr->map.base_addr); + (unsigned long) ptr->map.base_addr); if (ptr->map.mem_start) { printf("Memory:%lx-%lx ", ptr->map.mem_start, - ptr->map.mem_end); + ptr->map.mem_end); } if (ptr->map.dma) printf("DMA chan:%x ", ptr->map.dma); @@ -1168,7 +1167,7 @@ static struct interface *lookup_interface(char *name) #ifdef UNUSED static int for_all_interfaces(int (*doit) (struct interface *, void *), - void *cookie) + void *cookie) { struct interface *ife; diff --git a/networking/nc.c b/networking/nc.c index 1b32e3aa3..0c843a686 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -120,7 +120,7 @@ int nc_main(int argc, char **argv) /* getopt32 is _almost_ usable: ** it cannot handle "... -e PROG -prog-opt" */ while ((opt = getopt(argc, argv, - "" IF_NC_SERVER("lp:") IF_NC_EXTRA("w:i:f:e:") )) > 0 + "" IF_NC_SERVER("lp:") IF_NC_EXTRA("w:i:f:e:") )) > 0 ) { if (ENABLE_NC_SERVER && opt == 'l') IF_NC_SERVER(do_listen++); diff --git a/networking/ntpd.c b/networking/ntpd.c index 7facf9484..45485c080 100644 --- a/networking/ntpd.c +++ b/networking/ntpd.c @@ -1854,7 +1854,7 @@ recv_and_process_client_pkt(void /*int fd*/) msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM; msg.m_status |= (query_status & VERSION_MASK); msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ? - MODE_SERVER : MODE_SYM_PAS; + MODE_SERVER : MODE_SYM_PAS; msg.m_stratum = G.stratum; msg.m_ppoll = G.poll_exp; msg.m_precision_exp = G_precision_exp; @@ -2328,14 +2328,13 @@ set_freq(double freq) /* frequency update */ if (pps_enable) { if (!(pll_status & STA_PPSTIME)) report_event(EVNT_KERN, - NULL, "PPS enabled"); + NULL, "PPS enabled"); ntv.status |= STA_PPSTIME | STA_PPSFREQ; } else { if (pll_status & STA_PPSTIME) report_event(EVNT_KERN, - NULL, "PPS disabled"); - ntv.status &= ~(STA_PPSTIME | - STA_PPSFREQ); + NULL, "PPS disabled"); + ntv.status &= ~(STA_PPSTIME | STA_PPSFREQ); } if (sys_leap == LEAP_ADDSECOND) ntv.status |= STA_INS; @@ -2351,7 +2350,7 @@ set_freq(double freq) /* frequency update */ if (ntp_adjtime(&ntv) == TIME_ERROR) { if (!(ntv.status & STA_PPSSIGNAL)) report_event(EVNT_KERN, NULL, - "PPS no signal"); + "PPS no signal"); } pll_status = ntv.status; #ifdef STA_NANO diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c index 1b7c66b84..55bded8ff 100644 --- a/networking/ntpd_simple.c +++ b/networking/ntpd_simple.c @@ -710,7 +710,7 @@ recv_and_process_client_pkt(void /*int fd*/) msg.m_status = G.synced ? G.leap : LI_ALARM; msg.m_status |= (query_status & VERSION_MASK); msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ? - MODE_SERVER : MODE_SYM_PAS; + MODE_SERVER : MODE_SYM_PAS; msg.m_stratum = G.stratum; msg.m_ppoll = query_ppoll; msg.m_precision_exp = G_precision_exp; diff --git a/networking/ping.c b/networking/ping.c index b8a438ba8..3df67f5c3 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -724,7 +724,7 @@ static void ping6(len_and_sockaddr *lsa) ICMP6_FILTER_SETPASSALL(&filt); } if (setsockopt(pingsock, IPPROTO_ICMPV6, ICMP6_FILTER, &filt, - sizeof(filt)) < 0) + sizeof(filt)) < 0) bb_error_msg_and_die("setsockopt(ICMP6_FILTER)"); } #endif /*ICMP6_FILTER*/ diff --git a/networking/route.c b/networking/route.c index b7b5a02e6..45f2be542 100644 --- a/networking/route.c +++ b/networking/route.c @@ -409,7 +409,7 @@ static NOINLINE void INET6_setroute(int action, char **args) bb_error_msg_and_die("resolving %s", args_m1); } memcpy(&rt.rtmsg_gateway, sa6.sin6_addr.s6_addr, - sizeof(struct in6_addr)); + sizeof(struct in6_addr)); rt.rtmsg_flags |= RTF_GATEWAY; continue; } @@ -498,11 +498,11 @@ void FAST_FUNC bb_displayroutes(int noresolve, int netstatfmt) FILE *fp = xfopen_for_read("/proc/net/route"); printf("Kernel IP routing table\n" - "Destination Gateway Genmask Flags %s Iface\n", + "Destination Gateway Genmask Flags %s Iface\n", netstatfmt ? " MSS Window irtt" : "Metric Ref Use"); if (fscanf(fp, "%*[^\n]\n") < 0) { /* Skip the first line. */ - goto ERROR; /* Empty or missing line, or read error. */ + goto ERROR; /* Empty or missing line, or read error. */ } while (1) { int r; @@ -567,8 +567,8 @@ static void INET6_displayroutes(void) FILE *fp = xfopen_for_read("/proc/net/ipv6_route"); printf("Kernel IPv6 routing table\n%-44s%-40s" - "Flags Metric Ref Use Iface\n", - "Destination", "Next Hop"); + "Flags Metric Ref Use Iface\n", + "Destination", "Next Hop"); while (1) { int r; @@ -618,8 +618,8 @@ static void INET6_displayroutes(void) (struct sockaddr *) &snaddr6.sin6_addr); snaddr6.sin6_family = AF_INET6; naddr6 = INET6_rresolve((struct sockaddr_in6 *) &snaddr6, - 0x0fff /* Apparently, upstream never resolves. */ - ); + 0x0fff /* Apparently, upstream never resolves. */ + ); if (!r) { /* 1st pass */ snprintf(addr6, sizeof(addr6), "%s/%d", naddr6, prefix_len); diff --git a/procps/powertop.c b/procps/powertop.c index a69ee12b0..71988a295 100644 --- a/procps/powertop.c +++ b/procps/powertop.c @@ -493,7 +493,7 @@ static NOINLINE int process_timer_stats(void) * Get information about CPU using CPUID opcode. */ static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx, - unsigned int *edx) + unsigned int *edx) { /* EAX value specifies what information to return */ __asm__( diff --git a/procps/sysctl.c b/procps/sysctl.c index 878656862..c6a1de21d 100644 --- a/procps/sysctl.c +++ b/procps/sysctl.c @@ -205,7 +205,7 @@ static int sysctl_act_recursive(const char *path) continue; /* d_name is "." or ".." */ /* if path was ".", drop "./" prefix: */ retval |= sysctl_act_recursive((next[0] == '.' && next[1] == '/') ? - next + 2 : next); + next + 2 : next); free(next); } closedir(dirp); diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index ad54e22dd..2053cb146 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -253,7 +253,7 @@ enum { #define OPTION_PARAM &opt_m, &(G.logFile.path), &opt_l \ IF_FEATURE_ROTATE_LOGFILE(,&opt_s) \ IF_FEATURE_ROTATE_LOGFILE(,&opt_b) \ - IF_FEATURE_REMOTE_LOG( ,&remoteAddrList) \ + IF_FEATURE_REMOTE_LOG( ,&remoteAddrList) \ IF_FEATURE_IPC_SYSLOG( ,&opt_C) \ IF_FEATURE_SYSLOGD_CFG( ,&opt_f) diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c index 2f0854a30..b3e918fb0 100644 --- a/util-linux/fdformat.c +++ b/util-linux/fdformat.c @@ -116,7 +116,7 @@ int fdformat_main(int argc UNUSED_PARAM, char **argv) /* Check backwards so we don't need a counter */ while (--read_bytes >= 0) { if (data[read_bytes] != FD_FILL_BYTE) { - printf("bad data in cyl %d\nContinuing... ", cyl); + printf("bad data in cyl %d\nContinuing... ", cyl); } } } diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index c0be15a3a..39eb27b47 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c @@ -3023,7 +3023,7 @@ int fdisk_main(int argc UNUSED_PARAM, char **argv) printf("\nThe current boot file is: %s\n", sgi_get_bootfile()); if (read_maybe_empty("Please enter the name of the " - "new boot file: ") == '\n') + "new boot file: ") == '\n') printf("Boot file unchanged\n"); else sgi_set_bootfile(line_ptr); diff --git a/util-linux/flock.c b/util-linux/flock.c index e9be4eee9..05a747f72 100644 --- a/util-linux/flock.c +++ b/util-linux/flock.c @@ -45,7 +45,7 @@ int flock_main(int argc UNUSED_PARAM, char **argv) if (argv[1]) { fd = open(argv[0], O_RDONLY|O_NOCTTY|O_CREAT, 0666); if (fd < 0 && errno == EISDIR) - fd = open(argv[0], O_RDONLY|O_NOCTTY); + fd = open(argv[0], O_RDONLY|O_NOCTTY); if (fd < 0) bb_perror_msg_and_die("can't open '%s'", argv[0]); //TODO? close_on_exec_on(fd); diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c index 274050cdf..888f70ef8 100644 --- a/util-linux/ipcrm.c +++ b/util-linux/ipcrm.c @@ -160,7 +160,7 @@ int ipcrm_main(int argc, char **argv) /* convert key to id */ id = ((c == 'q') ? msgget(key, 0) : - (c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0)); + (c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0)); if (id < 0) { const char *errmsg; @@ -189,8 +189,8 @@ int ipcrm_main(int argc, char **argv) } result = ((c == 'q') ? msgctl(id, IPC_RMID, NULL) : - (c == 'm') ? shmctl(id, IPC_RMID, NULL) : - semctl(id, 0, IPC_RMID, arg)); + (c == 'm') ? shmctl(id, IPC_RMID, NULL) : + semctl(id, 0, IPC_RMID, arg)); if (result) { const char *errmsg; diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index ee7df5e33..8fdaf0b85 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c @@ -154,52 +154,52 @@ static NOINLINE void do_shm(void) /* glibc 2.1.3 and all earlier libc's have ints as fields of struct shminfo; glibc 2.1.91 has unsigned long; ach */ printf("max number of segments = %lu\n" - "max seg size (kbytes) = %lu\n" - "max total shared memory (pages) = %lu\n" - "min seg size (bytes) = %lu\n", - (unsigned long) shminfo.shmmni, - (unsigned long) (shminfo.shmmax >> 10), - (unsigned long) shminfo.shmall, - (unsigned long) shminfo.shmmin); + "max seg size (kbytes) = %lu\n" + "max total shared memory (pages) = %lu\n" + "min seg size (bytes) = %lu\n", + (unsigned long) shminfo.shmmni, + (unsigned long) (shminfo.shmmax >> 10), + (unsigned long) shminfo.shmall, + (unsigned long) shminfo.shmmin); return; case STATUS: printf("------ Shared Memory %s --------\n", "Status"); - printf( "segments allocated %d\n" - "pages allocated %ld\n" - "pages resident %ld\n" - "pages swapped %ld\n" - "Swap performance: %ld attempts\t%ld successes\n", - shm_info.used_ids, - shm_info.shm_tot, - shm_info.shm_rss, - shm_info.shm_swp, - shm_info.swap_attempts, shm_info.swap_successes); + printf("segments allocated %d\n" + "pages allocated %ld\n" + "pages resident %ld\n" + "pages swapped %ld\n" + "Swap performance: %ld attempts\t%ld successes\n", + shm_info.used_ids, + shm_info.shm_tot, + shm_info.shm_rss, + shm_info.shm_swp, + shm_info.swap_attempts, shm_info.swap_successes); return; case CREATOR: printf("------ Shared Memory %s --------\n", "Segment Creators/Owners"); - printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", - "shmid", "perms", "cuid", "cgid", "uid", "gid"); + printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", + "shmid", "perms", "cuid", "cgid", "uid", "gid"); break; case TIME: printf("------ Shared Memory %s --------\n", "Attach/Detach/Change Times"); - printf( "%-10s %-10s %-20s %-20s %-20s\n", - "shmid", "owner", "attached", "detached", "changed"); + printf("%-10s %-10s %-20s %-20s %-20s\n", + "shmid", "owner", "attached", "detached", "changed"); break; case PID: printf("------ Shared Memory %s --------\n", "Creator/Last-op"); - printf( "%-10s %-10s %-10s %-10s\n", - "shmid", "owner", "cpid", "lpid"); + printf("%-10s %-10s %-10s %-10s\n", + "shmid", "owner", "cpid", "lpid"); break; default: printf("------ Shared Memory %s --------\n", "Segments"); - printf( "%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", - "key", "shmid", "owner", "perms", "bytes", "nattch", - "status"); + printf("%-10s %-10s %-10s %-10s %-10s %-10s %-12s\n", + "key", "shmid", "owner", "perms", "bytes", "nattch", + "status"); break; } @@ -220,11 +220,11 @@ static NOINLINE void do_shm(void) printf("%-10d %-10d", shmid, ipcp->uid); /* ctime uses static buffer: use separate calls */ printf(" %-20.16s", shmseg.shm_atime - ? ctime(&shmseg.shm_atime) + 4 : "Not set"); + ? ctime(&shmseg.shm_atime) + 4 : "Not set"); printf(" %-20.16s", shmseg.shm_dtime - ? ctime(&shmseg.shm_dtime) + 4 : "Not set"); + ? ctime(&shmseg.shm_dtime) + 4 : "Not set"); printf(" %-20.16s\n", shmseg.shm_ctime - ? ctime(&shmseg.shm_ctime) + 4 : "Not set"); + ? ctime(&shmseg.shm_ctime) + 4 : "Not set"); break; case PID: if (pw) @@ -241,17 +241,17 @@ static NOINLINE void do_shm(void) else printf("%-10d %-10d", shmid, ipcp->uid); printf(" %-10o %-10lu %-10ld %-6s %-6s\n", ipcp->mode & 0777, - /* - * earlier: int, Austin has size_t - */ - (unsigned long) shmseg.shm_segsz, - /* - * glibc-2.1.3 and earlier has unsigned short; - * Austin has shmatt_t - */ - (long) shmseg.shm_nattch, - ipcp->mode & SHM_DEST ? "dest" : " ", - ipcp->mode & SHM_LOCKED ? "locked" : " "); + /* + * earlier: int, Austin has size_t + */ + (unsigned long) shmseg.shm_segsz, + /* + * glibc-2.1.3 and earlier has unsigned short; + * Austin has shmatt_t + */ + (long) shmseg.shm_nattch, + ipcp->mode & SHM_DEST ? "dest" : " ", + ipcp->mode & SHM_LOCKED ? "locked" : " "); break; } } @@ -281,32 +281,32 @@ static NOINLINE void do_sem(void) if ((semctl(0, 0, IPC_INFO, arg)) < 0) return; printf("max number of arrays = %d\n" - "max semaphores per array = %d\n" - "max semaphores system wide = %d\n" - "max ops per semop call = %d\n" - "semaphore max value = %d\n", - seminfo.semmni, - seminfo.semmsl, - seminfo.semmns, seminfo.semopm, seminfo.semvmx); + "max semaphores per array = %d\n" + "max semaphores system wide = %d\n" + "max ops per semop call = %d\n" + "semaphore max value = %d\n", + seminfo.semmni, + seminfo.semmsl, + seminfo.semmns, seminfo.semopm, seminfo.semvmx); return; case STATUS: printf("------ Semaphore %s --------\n", "Status"); - printf( "used arrays = %d\n" - "allocated semaphores = %d\n", - seminfo.semusz, seminfo.semaem); + printf("used arrays = %d\n" + "allocated semaphores = %d\n", + seminfo.semusz, seminfo.semaem); return; case CREATOR: printf("------ Semaphore %s --------\n", "Arrays Creators/Owners"); - printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", - "semid", "perms", "cuid", "cgid", "uid", "gid"); + printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", + "semid", "perms", "cuid", "cgid", "uid", "gid"); break; case TIME: printf("------ Shared Memory %s --------\n", "Operation/Change Times"); - printf( "%-8s %-10s %-26.24s %-26.24s\n", - "shmid", "owner", "last-op", "last-changed"); + printf("%-8s %-10s %-26.24s %-26.24s\n", + "shmid", "owner", "last-op", "last-changed"); break; case PID: @@ -314,8 +314,8 @@ static NOINLINE void do_sem(void) default: printf("------ Semaphore %s --------\n", "Arrays"); - printf( "%-10s %-10s %-10s %-10s %-10s\n", - "key", "semid", "owner", "perms", "nsems"); + printf("%-10s %-10s %-10s %-10s %-10s\n", + "key", "semid", "owner", "perms", "nsems"); break; } @@ -337,9 +337,9 @@ static NOINLINE void do_sem(void) printf("%-8d %-10d", semid, ipcp->uid); /* ctime uses static buffer: use separate calls */ printf(" %-26.24s", semary.sem_otime - ? ctime(&semary.sem_otime) : "Not set"); + ? ctime(&semary.sem_otime) : "Not set"); printf(" %-26.24s\n", semary.sem_ctime - ? ctime(&semary.sem_ctime) : "Not set"); + ? ctime(&semary.sem_ctime) : "Not set"); break; case PID: break; @@ -351,13 +351,13 @@ static NOINLINE void do_sem(void) else printf("%-10d %-9d", semid, ipcp->uid); printf(" %-10o %-10ld\n", ipcp->mode & 0777, - /* - * glibc-2.1.3 and earlier has unsigned short; - * glibc-2.1.91 has variation between - * unsigned short and unsigned long - * Austin prescribes unsigned short. - */ - (long) semary.sem_nsems); + /* + * glibc-2.1.3 and earlier has unsigned short; + * glibc-2.1.91 has variation between + * unsigned short and unsigned long + * Austin prescribes unsigned short. + */ + (long) semary.sem_nsems); break; } } @@ -383,42 +383,42 @@ static NOINLINE void do_msg(void) if ((msgctl(0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0) return; printf("------ Message%s --------\n", "s: Limits"); - printf( "max queues system wide = %d\n" - "max size of message (bytes) = %d\n" - "default max size of queue (bytes) = %d\n", - msginfo.msgmni, msginfo.msgmax, msginfo.msgmnb); + printf("max queues system wide = %d\n" + "max size of message (bytes) = %d\n" + "default max size of queue (bytes) = %d\n", + msginfo.msgmni, msginfo.msgmax, msginfo.msgmnb); return; case STATUS: printf("------ Message%s --------\n", "s: Status"); - printf( "allocated queues = %d\n" - "used headers = %d\n" - "used space = %d bytes\n", - msginfo.msgpool, msginfo.msgmap, msginfo.msgtql); + printf("allocated queues = %d\n" + "used headers = %d\n" + "used space = %d bytes\n", + msginfo.msgpool, msginfo.msgmap, msginfo.msgtql); return; case CREATOR: printf("------ Message%s --------\n", " Queues: Creators/Owners"); - printf( "%-10s %-10s %-10s %-10s %-10s %-10s\n", - "msqid", "perms", "cuid", "cgid", "uid", "gid"); + printf("%-10s %-10s %-10s %-10s %-10s %-10s\n", + "msqid", "perms", "cuid", "cgid", "uid", "gid"); break; case TIME: printf("------ Message%s --------\n", " Queues Send/Recv/Change Times"); - printf( "%-8s %-10s %-20s %-20s %-20s\n", - "msqid", "owner", "send", "recv", "change"); + printf("%-8s %-10s %-20s %-20s %-20s\n", + "msqid", "owner", "send", "recv", "change"); break; case PID: printf("------ Message%s --------\n", " Queues PIDs"); - printf( "%-10s %-10s %-10s %-10s\n", - "msqid", "owner", "lspid", "lrpid"); + printf("%-10s %-10s %-10s %-10s\n", + "msqid", "owner", "lspid", "lrpid"); break; default: printf("------ Message%s --------\n", " Queues"); - printf( "%-10s %-10s %-10s %-10s %-12s %-12s\n", - "key", "msqid", "owner", "perms", "used-bytes", "messages"); + printf("%-10s %-10s %-10s %-10s %-12s %-12s\n", + "key", "msqid", "owner", "perms", "used-bytes", "messages"); break; } @@ -438,11 +438,11 @@ static NOINLINE void do_msg(void) else printf("%-8d %-10d", msqid, ipcp->uid); printf(" %-20.16s", msgque.msg_stime - ? ctime(&msgque.msg_stime) + 4 : "Not set"); + ? ctime(&msgque.msg_stime) + 4 : "Not set"); printf(" %-20.16s", msgque.msg_rtime - ? ctime(&msgque.msg_rtime) + 4 : "Not set"); + ? ctime(&msgque.msg_rtime) + 4 : "Not set"); printf(" %-20.16s\n", msgque.msg_ctime - ? ctime(&msgque.msg_ctime) + 4 : "Not set"); + ? ctime(&msgque.msg_ctime) + 4 : "Not set"); break; case PID: if (pw) @@ -459,13 +459,13 @@ static NOINLINE void do_msg(void) else printf("%-10d %-10d", msqid, ipcp->uid); printf(" %-10o %-12ld %-12ld\n", ipcp->mode & 0777, - /* - * glibc-2.1.3 and earlier has unsigned short; - * glibc-2.1.91 has variation between - * unsigned short, unsigned long - * Austin has msgqnum_t - */ - (long) msgque.msg_cbytes, (long) msgque.msg_qnum); + /* + * glibc-2.1.3 and earlier has unsigned short; + * glibc-2.1.91 has variation between + * unsigned short, unsigned long + * Austin has msgqnum_t + */ + (long) msgque.msg_cbytes, (long) msgque.msg_qnum); break; } } @@ -483,18 +483,18 @@ static void print_shm(int shmid) } printf("\nShared memory Segment shmid=%d\n" - "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n" - "mode=%#o\taccess_perms=%#o\n" - "bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", - shmid, - ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, - ipcp->mode, ipcp->mode & 0777, - (long) shmds.shm_segsz, shmds.shm_lpid, shmds.shm_cpid, - (long) shmds.shm_nattch); + "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\n" + "mode=%#o\taccess_perms=%#o\n" + "bytes=%ld\tlpid=%d\tcpid=%d\tnattch=%ld\n", + shmid, + ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, + ipcp->mode, ipcp->mode & 0777, + (long) shmds.shm_segsz, shmds.shm_lpid, shmds.shm_cpid, + (long) shmds.shm_nattch); printf("att_time=%-26.24s\n", - shmds.shm_atime ? ctime(&shmds.shm_atime) : "Not set"); + shmds.shm_atime ? ctime(&shmds.shm_atime) : "Not set"); printf("det_time=%-26.24s\n", - shmds.shm_dtime ? ctime(&shmds.shm_dtime) : "Not set"); + shmds.shm_dtime ? ctime(&shmds.shm_dtime) : "Not set"); printf("change_time=%-26.24s\n\n", ctime(&shmds.shm_ctime)); } @@ -510,24 +510,24 @@ static void print_msg(int msqid) } printf("\nMessage Queue msqid=%d\n" - "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n" - "cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", - msqid, ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, ipcp->mode, - /* - * glibc-2.1.3 and earlier has unsigned short; - * glibc-2.1.91 has variation between - * unsigned short, unsigned long - * Austin has msgqnum_t (for msg_qbytes) - */ - (long) buf.msg_cbytes, (long) buf.msg_qbytes, - (long) buf.msg_qnum, buf.msg_lspid, buf.msg_lrpid); + "uid=%d\tgid=%d\tcuid=%d\tcgid=%d\tmode=%#o\n" + "cbytes=%ld\tqbytes=%ld\tqnum=%ld\tlspid=%d\tlrpid=%d\n", + msqid, ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, ipcp->mode, + /* + * glibc-2.1.3 and earlier has unsigned short; + * glibc-2.1.91 has variation between + * unsigned short, unsigned long + * Austin has msgqnum_t (for msg_qbytes) + */ + (long) buf.msg_cbytes, (long) buf.msg_qbytes, + (long) buf.msg_qnum, buf.msg_lspid, buf.msg_lrpid); printf("send_time=%-26.24s\n", - buf.msg_stime ? ctime(&buf.msg_stime) : "Not set"); + buf.msg_stime ? ctime(&buf.msg_stime) : "Not set"); printf("rcv_time=%-26.24s\n", - buf.msg_rtime ? ctime(&buf.msg_rtime) : "Not set"); + buf.msg_rtime ? ctime(&buf.msg_rtime) : "Not set"); printf("change_time=%-26.24s\n\n", - buf.msg_ctime ? ctime(&buf.msg_ctime) : "Not set"); + buf.msg_ctime ? ctime(&buf.msg_ctime) : "Not set"); } static void print_sem(int semid) @@ -544,19 +544,19 @@ static void print_sem(int semid) } printf("\nSemaphore Array semid=%d\n" - "uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n" - "mode=%#o, access_perms=%#o\n" - "nsems = %ld\n" - "otime = %-26.24s\n", - semid, - ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, - ipcp->mode, ipcp->mode & 0777, - (long) semds.sem_nsems, - semds.sem_otime ? ctime(&semds.sem_otime) : "Not set"); + "uid=%d\t gid=%d\t cuid=%d\t cgid=%d\n" + "mode=%#o, access_perms=%#o\n" + "nsems = %ld\n" + "otime = %-26.24s\n", + semid, + ipcp->uid, ipcp->gid, ipcp->cuid, ipcp->cgid, + ipcp->mode, ipcp->mode & 0777, + (long) semds.sem_nsems, + semds.sem_otime ? ctime(&semds.sem_otime) : "Not set"); printf("ctime = %-26.24s\n" - "%-10s %-10s %-10s %-10s %-10s\n", - ctime(&semds.sem_ctime), - "semnum", "value", "ncount", "zcount", "pid"); + "%-10s %-10s %-10s %-10s %-10s\n", + ctime(&semds.sem_ctime), + "semnum", "value", "ncount", "zcount", "pid"); arg.val = 0; for (i = 0; i < semds.sem_nsems; i++) { diff --git a/util-linux/lspci.c b/util-linux/lspci.c index 5184858d1..514678afd 100644 --- a/util-linux/lspci.c +++ b/util-linux/lspci.c @@ -74,11 +74,11 @@ static int FAST_FUNC fileAction( if (option_mask32 & OPT_m) { printf("%s \"Class %04x\" \"%04x\" \"%04x\" \"%04x\" \"%04x\"", - pci_slot_name, pci_class, pci_vid, pci_did, - pci_subsys_vid, pci_subsys_did); + pci_slot_name, pci_class, pci_vid, pci_did, + pci_subsys_vid, pci_subsys_did); } else { printf("%s Class %04x: %04x:%04x", - pci_slot_name, pci_class, pci_vid, pci_did); + pci_slot_name, pci_class, pci_vid, pci_did); } if ((option_mask32 & OPT_k) && driver) { diff --git a/util-linux/mount.c b/util-linux/mount.c index 525fdcce9..bcb298c07 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -927,7 +927,7 @@ static bool_t xdr_fhandle(XDR *xdrs, fhandle objp) static bool_t xdr_fhstatus(XDR *xdrs, fhstatus *objp) { if (!xdr_u_int(xdrs, &objp->fhs_status)) - return FALSE; + return FALSE; if (objp->fhs_status == 0) return xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle); return TRUE; @@ -941,8 +941,8 @@ static bool_t xdr_dirpath(XDR *xdrs, dirpath *objp) static bool_t xdr_fhandle3(XDR *xdrs, fhandle3 *objp) { return xdr_bytes(xdrs, (char **)&objp->fhandle3_val, - (unsigned int *) &objp->fhandle3_len, - FHSIZE3); + (unsigned int *) &objp->fhandle3_len, + FHSIZE3); } static bool_t xdr_mountres3_ok(XDR *xdrs, mountres3_ok *objp) @@ -950,10 +950,10 @@ static bool_t xdr_mountres3_ok(XDR *xdrs, mountres3_ok *objp) if (!xdr_fhandle3(xdrs, &objp->fhandle)) return FALSE; return xdr_array(xdrs, &(objp->auth_flavours.auth_flavours_val), - &(objp->auth_flavours.auth_flavours_len), - ~0, - sizeof(int), - (xdrproc_t) xdr_int); + &(objp->auth_flavours.auth_flavours_len), + ~0, + sizeof(int), + (xdrproc_t) xdr_int); } static bool_t xdr_mountstat3(XDR *xdrs, mountstat3 *objp) @@ -1522,19 +1522,19 @@ static NOINLINE int nfsmount(struct mntent *mp, unsigned long vfsflags, char *fi switch (pm_mnt.pm_prot) { case IPPROTO_UDP: mclient = clntudp_create(&mount_server_addr, - pm_mnt.pm_prog, - pm_mnt.pm_vers, - retry_timeout, - &msock); + pm_mnt.pm_prog, + pm_mnt.pm_vers, + retry_timeout, + &msock); if (mclient) break; mount_server_addr.sin_port = htons(pm_mnt.pm_port); msock = RPC_ANYSOCK; case IPPROTO_TCP: mclient = clnttcp_create(&mount_server_addr, - pm_mnt.pm_prog, - pm_mnt.pm_vers, - &msock, 0, 0); + pm_mnt.pm_prog, + pm_mnt.pm_vers, + &msock, 0, 0); break; default: mclient = NULL; @@ -1555,18 +1555,18 @@ static NOINLINE int nfsmount(struct mntent *mp, unsigned long vfsflags, char *fi if (pm_mnt.pm_vers == 3) clnt_stat = clnt_call(mclient, MOUNTPROC3_MNT, - (xdrproc_t) xdr_dirpath, - (caddr_t) &pathname, - (xdrproc_t) xdr_mountres3, - (caddr_t) &status, - total_timeout); + (xdrproc_t) xdr_dirpath, + (caddr_t) &pathname, + (xdrproc_t) xdr_mountres3, + (caddr_t) &status, + total_timeout); else clnt_stat = clnt_call(mclient, MOUNTPROC_MNT, - (xdrproc_t) xdr_dirpath, - (caddr_t) &pathname, - (xdrproc_t) xdr_fhstatus, - (caddr_t) &status, - total_timeout); + (xdrproc_t) xdr_dirpath, + (caddr_t) &pathname, + (xdrproc_t) xdr_fhstatus, + (caddr_t) &status, + total_timeout); if (clnt_stat == RPC_SUCCESS) goto prepare_kernel_data; /* we're done */ diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c index 4ed801137..974fe89c4 100644 --- a/util-linux/readprofile.c +++ b/util-linux/readprofile.c @@ -163,7 +163,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) while (fgets(mapline, S_LEN, map)) { if (sscanf(mapline, "%llx %s %s", &fn_add, mode, fn_name) != 3) bb_error_msg_and_die("%s(%i): wrong map line", - mapFile, maplineno); + mapFile, maplineno); if (!strcmp(fn_name, "_stext")) /* only elf works like this */ { add0 = fn_add; @@ -198,7 +198,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) if (indx >= len / sizeof(*buf)) bb_error_msg_and_die("profile address out of range. " - "Wrong map file?"); + "Wrong map file?"); while (indx < (next_add-add0)/step) { if (optBins && (buf[indx] || optAll)) { @@ -220,10 +220,10 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) ) { if (optVerbose) printf("%016llx %-40s %6i %8.4f\n", fn_add, - fn_name, this, this/(double)fn_len); + fn_name, this, this/(double)fn_len); else printf("%6i %-40s %8.4f\n", - this, fn_name, this/(double)fn_len); + this, fn_name, this/(double)fn_len); if (optSub) { unsigned long long scan; @@ -233,8 +233,8 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) addr = (scan - 1)*step + add0; printf("\t%#llx\t%s+%#llx\t%u\n", - addr, fn_name, addr - fn_add, - buf[scan]); + addr, fn_name, addr - fn_add, + buf[scan]); } } } @@ -251,10 +251,10 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv) /* trailer */ if (optVerbose) printf("%016x %-40s %6i %8.4f\n", - 0, "total", total, total/(double)(fn_add-add0)); + 0, "total", total, total/(double)(fn_add-add0)); else printf("%6i %-40s %8.4f\n", - total, "total", total/(double)(fn_add-add0)); + total, "total", total/(double)(fn_add-add0)); fclose(map); free(buf); diff --git a/util-linux/volume_id/linux_raid.c b/util-linux/volume_id/linux_raid.c index 761e54f9f..209eaabe9 100644 --- a/util-linux/volume_id/linux_raid.c +++ b/util-linux/volume_id/linux_raid.c @@ -69,9 +69,9 @@ int FAST_FUNC volume_id_probe_linux_raid(struct volume_id *id /*,uint64_t off*/, volume_id_set_uuid(id, uuid, UUID_DCE); // snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u", -// le32_to_cpu(mdp->major_version), -// le32_to_cpu(mdp->minor_version), -// le32_to_cpu(mdp->patch_version)); +// le32_to_cpu(mdp->major_version), +// le32_to_cpu(mdp->minor_version), +// le32_to_cpu(mdp->patch_version)); dbg("found raid signature"); // volume_id_set_usage(id, VOLUME_ID_RAID); diff --git a/util-linux/volume_id/util.c b/util-linux/volume_id/util.c index 0e2d24be0..061545fde 100644 --- a/util-linux/volume_id/util.c +++ b/util-linux/volume_id/util.c @@ -129,7 +129,7 @@ void volume_id_set_label_string(struct volume_id *id, const uint8_t *buf, size_t void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enum endian endianess, size_t count) { - volume_id_set_unicode16(id->label, sizeof(id->label), buf, endianess, count); + volume_id_set_unicode16(id->label, sizeof(id->label), buf, endianess, count); } void volume_id_set_uuid(struct volume_id *id, const uint8_t *buf, enum uuid_format format) -- cgit v1.2.3-55-g6feb From 60cb48ca50fcff24aa6c3927f51e4a508fa118f4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 14 Jan 2013 15:57:44 +0100 Subject: whitespace cleanup. no code changes Signed-off-by: Denys Vlasenko --- archival/cpio.c | 30 ++++++------- archival/libarchive/decompress_gunzip.c | 4 +- archival/libarchive/decompress_uncompress.c | 4 +- archival/libarchive/lzo1x_9x.c | 12 +++--- archival/libarchive/lzo1x_c.c | 2 +- archival/libarchive/lzo1x_d.c | 2 +- archival/lzop.c | 8 ++-- coreutils/cal.c | 7 +-- coreutils/mknod.c | 2 +- coreutils/od_bloaty.c | 4 +- coreutils/stat.c | 58 ++++++++++++++----------- coreutils/stty.c | 2 +- coreutils/test.c | 2 +- editors/awk.c | 2 +- editors/diff.c | 2 +- editors/vi.c | 2 +- findutils/grep.c | 2 +- init/init.c | 2 +- libbb/inet_common.c | 4 +- libbb/loop.c | 6 +-- libbb/procps.c | 2 +- libbb/selinux_common.c | 2 +- libpwdgrp/pwd_grp.c | 14 +++--- miscutils/devfsd.c | 26 +++++------ miscutils/hdparm.c | 4 +- miscutils/last_fancy.c | 16 +++---- modutils/rmmod.c | 2 +- networking/brctl.c | 8 ++-- networking/ether-wake.c | 8 ++-- networking/ifenslave.c | 2 +- networking/interface.c | 2 +- networking/libiproute/ipaddress.c | 10 +++-- networking/libiproute/iprule.c | 14 +++--- networking/libiproute/iptunnel.c | 2 +- networking/netstat.c | 2 +- networking/route.c | 4 +- networking/tc.c | 5 ++- networking/traceroute.c | 7 +-- networking/udhcp/dhcpc.c | 2 +- procps/nmeter.c | 2 +- procps/top.c | 2 +- runit/runsv.c | 2 +- runit/svlogd.c | 4 +- selinux/chcon.c | 20 ++++----- selinux/runcon.c | 10 ++--- selinux/sestatus.c | 2 +- selinux/setfiles.c | 19 ++++---- shell/ash.c | 8 ++-- shell/hush.c | 4 +- shell/math.c | 2 +- util-linux/fdisk_osf.c | 5 +-- util-linux/fsck_minix.c | 67 ++++++++++++++--------------- util-linux/getopt.c | 2 +- util-linux/ipcs.c | 2 +- util-linux/volume_id/nilfs.c | 2 +- util-linux/volume_id/ntfs.c | 4 +- util-linux/volume_id/udf.c | 2 +- util-linux/volume_id/unused_msdos.c | 2 +- util-linux/volume_id/unused_silicon_raid.c | 2 +- 59 files changed, 233 insertions(+), 219 deletions(-) (limited to 'miscutils') diff --git a/archival/cpio.c b/archival/cpio.c index 98cc18fa0..699c6dbb7 100644 --- a/archival/cpio.c +++ b/archival/cpio.c @@ -253,24 +253,24 @@ static NOINLINE int cpio_o(void) } bytes += printf("070701" - "%08X%08X%08X%08X%08X%08X%08X" - "%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */ + "%08X%08X%08X%08X%08X%08X%08X" + "%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */ /* strlen+1: */ "%08X" /* chksum: */ "00000000" /* (only for "070702" files) */ /* name,NUL: */ "%s%c", - (unsigned)(uint32_t) st.st_ino, - (unsigned)(uint32_t) st.st_mode, - (unsigned)(uint32_t) st.st_uid, - (unsigned)(uint32_t) st.st_gid, - (unsigned)(uint32_t) st.st_nlink, - (unsigned)(uint32_t) st.st_mtime, - (unsigned)(uint32_t) st.st_size, - (unsigned)(uint32_t) major(st.st_dev), - (unsigned)(uint32_t) minor(st.st_dev), - (unsigned)(uint32_t) major(st.st_rdev), - (unsigned)(uint32_t) minor(st.st_rdev), - (unsigned)(strlen(name) + 1), - name, '\0'); + (unsigned)(uint32_t) st.st_ino, + (unsigned)(uint32_t) st.st_mode, + (unsigned)(uint32_t) st.st_uid, + (unsigned)(uint32_t) st.st_gid, + (unsigned)(uint32_t) st.st_nlink, + (unsigned)(uint32_t) st.st_mtime, + (unsigned)(uint32_t) st.st_size, + (unsigned)(uint32_t) major(st.st_dev), + (unsigned)(uint32_t) minor(st.st_dev), + (unsigned)(uint32_t) major(st.st_rdev), + (unsigned)(uint32_t) minor(st.st_rdev), + (unsigned)(strlen(name) + 1), + name, '\0'); bytes = cpio_pad4(bytes); if (st.st_size) { diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c index 2d5ab3eb3..4e6b138c3 100644 --- a/archival/libarchive/decompress_gunzip.c +++ b/archival/libarchive/decompress_gunzip.c @@ -293,8 +293,8 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current * m: maximum lookup bits, returns actual */ static int huft_build(const unsigned *b, const unsigned n, - const unsigned s, const unsigned short *d, - const unsigned char *e, huft_t **t, unsigned *m) + const unsigned s, const unsigned short *d, + const unsigned char *e, huft_t **t, unsigned *m) { unsigned a; /* counter for codes of length k */ unsigned c[BMAX + 1]; /* bit length count table */ diff --git a/archival/libarchive/decompress_uncompress.c b/archival/libarchive/decompress_uncompress.c index 3826a65ea..53c27080f 100644 --- a/archival/libarchive/decompress_uncompress.c +++ b/archival/libarchive/decompress_uncompress.c @@ -235,8 +235,8 @@ unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd) p = &inbuf[posbits >> 3]; bb_error_msg ("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)", - insize, posbits, p[-1], p[0], p[1], p[2], p[3], - (posbits & 07)); + insize, posbits, p[-1], p[0], p[1], p[2], p[3], + (posbits & 07)); */ bb_error_msg("corrupted data"); goto err; diff --git a/archival/libarchive/lzo1x_9x.c b/archival/libarchive/lzo1x_9x.c index 483205155..897132987 100644 --- a/archival/libarchive/lzo1x_9x.c +++ b/archival/libarchive/lzo1x_9x.c @@ -644,7 +644,7 @@ static int len_of_coded_match(unsigned m_len, unsigned m_off, unsigned lit) static int min_gain(unsigned ahead, unsigned lit1, - unsigned lit2, int l1, int l2, int l3) + unsigned lit2, int l1, int l2, int l3) { int lazy_match_min_gain = 0; @@ -673,7 +673,7 @@ static int min_gain(unsigned ahead, unsigned lit1, #if defined(SWD_BEST_OFF) static void better_match(const lzo_swd_p swd, - unsigned *m_len, unsigned *m_off) + unsigned *m_len, unsigned *m_off) { if (*m_len <= M2_MIN_LEN) return; @@ -914,8 +914,8 @@ int lzo1x_999_compress_level(const uint8_t *in, unsigned in_len, compression_level -= 7; return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem, - c[compression_level].good_length, - c[compression_level].max_lazy, - c[compression_level].max_chain, - c[compression_level].use_best_off); + c[compression_level].good_length, + c[compression_level].max_lazy, + c[compression_level].max_chain, + c[compression_level].use_best_off); } diff --git a/archival/libarchive/lzo1x_c.c b/archival/libarchive/lzo1x_c.c index cc86f74b1..8c77072ab 100644 --- a/archival/libarchive/lzo1x_c.c +++ b/archival/libarchive/lzo1x_c.c @@ -15,7 +15,7 @@ The LZO library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License diff --git a/archival/libarchive/lzo1x_d.c b/archival/libarchive/lzo1x_d.c index 348a85510..9bc1270da 100644 --- a/archival/libarchive/lzo1x_d.c +++ b/archival/libarchive/lzo1x_d.c @@ -15,7 +15,7 @@ The LZO library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License diff --git a/archival/lzop.c b/archival/lzop.c index ec4e784ed..56003d421 100644 --- a/archival/lzop.c +++ b/archival/lzop.c @@ -14,7 +14,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License @@ -116,7 +116,7 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len, unsigned nl; unsigned long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0; -// LZO_UNUSED(wrkmem); +// LZO_UNUSED(wrkmem); *out_len = 0; @@ -346,8 +346,8 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len, return LZO_E_EOF_NOT_FOUND; eof_found: -// LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2); -// LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b); +// LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2); +// LZO_UNUSED(o_m3_a); LZO_UNUSED(o_m3_b); *out_len = pd(op, out); return (ip == ip_end ? LZO_E_OK : (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); diff --git a/coreutils/cal.c b/coreutils/cal.c index 158b23fbc..0b2307349 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c @@ -181,10 +181,11 @@ int cal_main(int argc UNUSED_PARAM, char **argv) sprintf(lineout, "%u", year); center(lineout, - (WEEK_LEN * 3 + HEAD_SEP * 2) - + julian * (J_WEEK_LEN * 2 + HEAD_SEP + (WEEK_LEN * 3 + HEAD_SEP * 2) + + julian * (J_WEEK_LEN * 2 + HEAD_SEP - (WEEK_LEN * 3 + HEAD_SEP * 2)), - 0); + 0 + ); puts("\n"); /* two \n's */ for (i = 0; i < 12; i++) { day_array(i + 1, year, days[i]); diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 32d3659ac..aa0450481 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -59,7 +59,7 @@ int mknod_main(int argc, char **argv) /* Autodetect what the system supports; these macros should * optimize out to two constants. */ dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)), - xatoul_range(argv[3], 0, minor(UINT_MAX))); + xatoul_range(argv[3], 0, minor(UINT_MAX))); } } diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 2f6650153..b408a8477 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c @@ -1021,12 +1021,12 @@ dump(off_t current_offset, off_t end_offset) l_c_m = get_lcm(); /* Make bytes_to_write the smallest multiple of l_c_m that - is at least as large as n_bytes_read. */ + is at least as large as n_bytes_read. */ bytes_to_write = l_c_m * ((n_bytes_read + l_c_m - 1) / l_c_m); memset(block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read); write_block(current_offset, bytes_to_write, - block[idx ^ 1], block[idx]); + block[idx ^ 1], block[idx]); current_offset += n_bytes_read; } diff --git a/coreutils/stat.c b/coreutils/stat.c index e38c8f6b0..c8677ebaa 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -591,37 +591,43 @@ static bool do_stat(const char *filename, const char *format) # else if (option_mask32 & OPT_TERSE) { format = (option_mask32 & OPT_SELINUX ? - "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n": - "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n"); + "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n" + : + "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n" + ); } else { if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) { format = (option_mask32 & OPT_SELINUX ? - " File: %N\n" - " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" - "Device: %Dh/%dd\tInode: %-10i Links: %-5h" - " Device type: %t,%T\n" - "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" - " S_Context: %C\n" - "Access: %x\n" "Modify: %y\n" "Change: %z\n": - " File: %N\n" - " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" - "Device: %Dh/%dd\tInode: %-10i Links: %-5h" - " Device type: %t,%T\n" - "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" - "Access: %x\n" "Modify: %y\n" "Change: %z\n"); + " File: %N\n" + " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" + "Device: %Dh/%dd\tInode: %-10i Links: %-5h" + " Device type: %t,%T\n" + "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" + " S_Context: %C\n" + "Access: %x\n" "Modify: %y\n" "Change: %z\n" + : + " File: %N\n" + " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" + "Device: %Dh/%dd\tInode: %-10i Links: %-5h" + " Device type: %t,%T\n" + "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" + "Access: %x\n" "Modify: %y\n" "Change: %z\n" + ); } else { format = (option_mask32 & OPT_SELINUX ? - " File: %N\n" - " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" - "Device: %Dh/%dd\tInode: %-10i Links: %h\n" - "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" - "S_Context: %C\n" - "Access: %x\n" "Modify: %y\n" "Change: %z\n": - " File: %N\n" - " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" - "Device: %Dh/%dd\tInode: %-10i Links: %h\n" - "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" - "Access: %x\n" "Modify: %y\n" "Change: %z\n"); + " File: %N\n" + " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" + "Device: %Dh/%dd\tInode: %-10i Links: %h\n" + "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" + "S_Context: %C\n" + "Access: %x\n" "Modify: %y\n" "Change: %z\n" + : + " File: %N\n" + " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" + "Device: %Dh/%dd\tInode: %-10i Links: %h\n" + "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" + "Access: %x\n" "Modify: %y\n" "Change: %z\n" + ); } } # endif diff --git a/coreutils/stty.c b/coreutils/stty.c index 0668cf7be..96754dd84 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -1056,7 +1056,7 @@ static void do_display(const struct termios *mode, int all) } #endif wrapf("%s = %s;", nth_string(control_name, i), - visible(mode->c_cc[control_info[i].offset])); + visible(mode->c_cc[control_info[i].offset])); } #if VEOF == VMIN if ((mode->c_lflag & ICANON) == 0) diff --git a/coreutils/test.c b/coreutils/test.c index 0bc008e7c..4df505a05 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -610,7 +610,7 @@ static int test_eaccess(char *path, int mode) return 0; /* Root can execute any file that has any one of the execute - bits set. */ + * bits set. */ if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) return 0; } diff --git a/editors/awk.c b/editors/awk.c index 42f6ef866..3224788c0 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -155,7 +155,7 @@ typedef struct tsplitter_s { /* simple token classes */ /* Order and hex values are very important!!! See next_token() */ -#define TC_SEQSTART 1 /* ( */ +#define TC_SEQSTART 1 /* ( */ #define TC_SEQTERM (1 << 1) /* ) */ #define TC_REGEXP (1 << 2) /* /.../ */ #define TC_OUTRDR (1 << 3) /* | > >> */ diff --git a/editors/diff.c b/editors/diff.c index 3a3334640..b08ded3a1 100644 --- a/editors/diff.c +++ b/editors/diff.c @@ -843,7 +843,7 @@ static void diffdir(char *p[2], const char *s_start) * add_to_dirlist will remove it. */ list[i].len = strlen(p[i]); recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, - add_to_dirlist, skip_dir, &list[i], 0); + add_to_dirlist, skip_dir, &list[i], 0); /* Sort dl alphabetically. * GNU diff does this ignoring any number of trailing dots. * We don't, so for us dotted files almost always are diff --git a/editors/vi.c b/editors/vi.c index e09e0d9c7..b1776c668 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -14,7 +14,7 @@ * add :help command * :map macros * if mark[] values were line numbers rather than pointers - * it would be easier to change the mark when add/delete lines + * it would be easier to change the mark when add/delete lines * More intelligence in refresh() * ":r !cmd" and "!cmd" to filter text through an external command * A true "undo" facility diff --git a/findutils/grep.c b/findutils/grep.c index f14d6e6c1..de4fcf5ad 100644 --- a/findutils/grep.c +++ b/findutils/grep.c @@ -638,7 +638,7 @@ int grep_main(int argc UNUSED_PARAM, char **argv) if (opts & OPT_C) { /* -C unsets prev -A and -B, but following -A or -B - may override it */ + * may override it */ if (!(opts & OPT_A)) /* not overridden */ lines_after = Copt; if (!(opts & OPT_B)) /* not overridden */ diff --git a/init/init.c b/init/init.c index 724894698..b84bdccbc 100644 --- a/init/init.c +++ b/init/init.c @@ -520,7 +520,7 @@ static pid_t run(const struct init_action *a) /* Log the process name and args */ message(L_LOG, "starting pid %d, tty '%s': '%s'", - getpid(), a->terminal, a->command); + getpid(), a->terminal, a->command); /* Now run it. The new program will take over this PID, * so nothing further in init.c should be run. */ diff --git a/libbb/inet_common.c b/libbb/inet_common.c index 7208db9ea..0f4fca1a2 100644 --- a/libbb/inet_common.c +++ b/libbb/inet_common.c @@ -97,7 +97,7 @@ char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t ne if (s_in->sin_family != AF_INET) { #ifdef DEBUG bb_error_msg("rresolve: unsupported address family %d!", - s_in->sin_family); + s_in->sin_family); #endif errno = EAFNOSUPPORT; return NULL; @@ -195,7 +195,7 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) if (sin6->sin6_family != AF_INET6) { #ifdef DEBUG bb_error_msg("rresolve: unsupported address family %d!", - sin6->sin6_family); + sin6->sin6_family); #endif errno = EAFNOSUPPORT; return NULL; diff --git a/libbb/loop.c b/libbb/loop.c index b3a520848..823fba079 100644 --- a/libbb/loop.c +++ b/libbb/loop.c @@ -150,9 +150,9 @@ int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse } /* If this block device already set up right, re-use it. - (Yes this is racy, but associating two loop devices with the same - file isn't pretty either. In general, mounting the same file twice - without using losetup manually is problematic.) + * (Yes this is racy, but associating two loop devices with the same + * file isn't pretty either. In general, mounting the same file twice + * without using losetup manually is problematic.) */ } else if (strcmp(file, (char *)loopinfo.lo_file_name) != 0 diff --git a/libbb/procps.c b/libbb/procps.c index b4557e797..5b68d3431 100644 --- a/libbb/procps.c +++ b/libbb/procps.c @@ -180,7 +180,7 @@ static char *skip_fields(char *str, int count) #if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, - void (*cb)(struct smaprec *, void *), void *data) + void (*cb)(struct smaprec *, void *), void *data) { FILE *file; struct smaprec currec; diff --git a/libbb/selinux_common.c b/libbb/selinux_common.c index 62910e285..c2585557f 100644 --- a/libbb/selinux_common.c +++ b/libbb/selinux_common.c @@ -10,7 +10,7 @@ #include context_t FAST_FUNC set_security_context_component(security_context_t cur_context, - char *user, char *role, char *type, char *range) + char *user, char *role, char *type, char *range) { context_t con = context_new(cur_context); if (!con) diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index edf53f350..2060d7811 100644 --- a/libpwdgrp/pwd_grp.c +++ b/libpwdgrp/pwd_grp.c @@ -300,8 +300,8 @@ struct group *getgrgid(gid_t gid) * to have been created as a reentrant version of the non-standard * functions getspuid. Why getspuid was added, I do not know. */ int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf, - char *__restrict buffer, size_t buflen, - struct spwd **__restrict result) + char *__restrict buffer, size_t buflen, + struct spwd **__restrict result) { int rv; struct passwd *pp; @@ -403,8 +403,8 @@ void endpwent(void) int getpwent_r(struct passwd *__restrict resultbuf, - char *__restrict buffer, size_t buflen, - struct passwd **__restrict result) + char *__restrict buffer, size_t buflen, + struct passwd **__restrict result) { int rv; @@ -451,8 +451,8 @@ void endgrent(void) } int getgrent_r(struct group *__restrict resultbuf, - char *__restrict buffer, size_t buflen, - struct group **__restrict result) + char *__restrict buffer, size_t buflen, + struct group **__restrict result) { int rv; @@ -501,7 +501,7 @@ void endspent(void) } int getspent_r(struct spwd *resultbuf, char *buffer, - size_t buflen, struct spwd **result) + size_t buflen, struct spwd **result) { int rv; diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 6493fe4f1..2e87261cf 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -219,7 +219,7 @@ static void action_execute(const struct devfsd_notify_struct *, const struct con const regmatch_t *, unsigned); static void action_modload(const struct devfsd_notify_struct *info, const struct config_entry_struct *entry); static void action_copy(const struct devfsd_notify_struct *, const struct config_entry_struct *, - const regmatch_t *, unsigned); + const regmatch_t *, unsigned); static void action_compat(const struct devfsd_notify_struct *, unsigned); static void free_config(void); static void restore(char *spath, struct stat source_stat, int rootlen); @@ -229,12 +229,12 @@ static void signal_handler(int); static const char *get_variable(const char *, void *); static int make_dir_tree(const char *); static int expand_expression(char *, unsigned, const char *, const char *(*)(const char *, void *), void *, - const char *, const regmatch_t *, unsigned); + const char *, const regmatch_t *, unsigned); static void expand_regexp(char *, size_t, const char *, const char *, const regmatch_t *, unsigned); static const char *expand_variable( char *, unsigned, unsigned *, const char *, const char *(*)(const char *, void *), void *); static const char *get_variable_v2(const char *, const char *(*)(const char *, void *), void *); -static char get_old_ide_name(unsigned , unsigned); +static char get_old_ide_name(unsigned, unsigned); static char *write_old_sd_name(char *, unsigned, unsigned, const char *); /* busybox functions */ @@ -580,9 +580,9 @@ static void process_config_line(const char *line, unsigned long *event_mask) /*This action will pass "/dev/$devname"(i.e. "/dev/" prefixed to the device name) to the module loading facility. In addition, the /etc/modules.devfs configuration file is used.*/ - if (ENABLE_DEVFSD_MODLOAD) + if (ENABLE_DEVFSD_MODLOAD) new->action.what = AC_MODLOAD; - break; + break; case 6: /* EXECUTE */ new->action.what = AC_EXECUTE; num_args -= 3; @@ -750,7 +750,7 @@ static void action_permissions(const struct devfsd_notify_struct *info, } /* End Function action_permissions */ static void action_modload(const struct devfsd_notify_struct *info, - const struct config_entry_struct *entry UNUSED_PARAM) + const struct config_entry_struct *entry UNUSED_PARAM) /* [SUMMARY] Load a module. The devfs change. The config file entry. @@ -771,8 +771,8 @@ static void action_modload(const struct devfsd_notify_struct *info, } /* End Function action_modload */ static void action_execute(const struct devfsd_notify_struct *info, - const struct config_entry_struct *entry, - const regmatch_t *regexpr, unsigned int numexpr) + const struct config_entry_struct *entry, + const regmatch_t *regexpr, unsigned int numexpr) /* [SUMMARY] Execute a programme. The devfs change. The config file entry. @@ -1641,10 +1641,10 @@ st_expr_expand_out: /* Private functions follow */ static const char *expand_variable(char *buffer, unsigned int length, - unsigned int *out_pos, const char *input, - const char *(*func)(const char *variable, + unsigned int *out_pos, const char *input, + const char *(*func)(const char *variable, void *info), - void *info) + void *info) /* [SUMMARY] Expand a variable. The buffer to write to. The length of the output buffer. @@ -1786,8 +1786,8 @@ expand_variable_out: static const char *get_variable_v2(const char *variable, - const char *(*func)(const char *variable, void *info), - void *info) + const char *(*func)(const char *variable, void *info), + void *info) /* [SUMMARY] Get a variable from the environment or . The variable name. A function which will be used to get the variable. If this returns diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index a97f3e7b5..9c6dbf468 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -1022,8 +1022,8 @@ static void identify(uint16_t *val) } if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) { /* We print out elsewhere whether the APM feature is enabled or - not. If it's not enabled, let's not repeat the info; just print - nothing here. */ + * not. If it's not enabled, let's not repeat the info; just print + * nothing here. */ printf("\tAdvancedPM level: "); if ((val[ADV_PWR] & 0xFF00) == 0x4000) { uint8_t apm_level = val[ADV_PWR] & 0x00FF; diff --git a/miscutils/last_fancy.c b/miscutils/last_fancy.c index dc09b65fb..f687d7e16 100644 --- a/miscutils/last_fancy.c +++ b/miscutils/last_fancy.c @@ -93,14 +93,14 @@ static void show_entry(struct utmp *ut, int state, time_t dur_secs) } printf(HEADER_FORMAT, - ut->ut_user, - ut->ut_line, - show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, - show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, - ut->ut_host, - login_time, - logout_str, - duration_str); + ut->ut_user, + ut->ut_line, + show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, + show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, + ut->ut_host, + login_time, + logout_str, + duration_str); } static int get_ut_type(struct utmp *ut) diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 4a4a91982..f13ff9eb6 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c @@ -60,7 +60,7 @@ int rmmod_main(int argc UNUSED_PARAM, char **argv) filename2modname(bname, modname); if (bb_delete_module(modname, flags)) bb_error_msg_and_die("can't unload '%s': %s", - modname, moderror(errno)); + modname, moderror(errno)); } return EXIT_SUCCESS; diff --git a/networking/brctl.c b/networking/brctl.c index b4f5809df..207b069aa 100644 --- a/networking/brctl.c +++ b/networking/brctl.c @@ -133,9 +133,9 @@ int brctl_main(int argc UNUSED_PARAM, char **argv) enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif IF_FEATURE_BRCTL_FANCY(, - ARG_stp, - ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage, - ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio + ARG_stp, + ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage, + ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio ) IF_FEATURE_BRCTL_SHOW(, ARG_show) }; @@ -285,7 +285,7 @@ int brctl_main(int argc UNUSED_PARAM, char **argv) bb_error_msg_and_die(bb_msg_invalid_arg, *argv, "port"); memset(ifidx, 0, sizeof ifidx); arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx, - MAX_PORTS); + MAX_PORTS); xioctl(fd, SIOCDEVPRIVATE, &ifr); for (i = 0; i < MAX_PORTS; i++) { if (ifidx[i] == port) { diff --git a/networking/ether-wake.c b/networking/ether-wake.c index a73b0baea..bf09cd529 100644 --- a/networking/ether-wake.c +++ b/networking/ether-wake.c @@ -49,9 +49,9 @@ * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. * * The author may be reached as becker@scyld, or C/O - * Scyld Computing Corporation - * 914 Bay Ridge Road, Suite 220 - * Annapolis MD 21403 + * Scyld Computing Corporation + * 914 Bay Ridge Road, Suite 220 + * Annapolis MD 21403 * * Notes: * On some systems dropping root capability allows the process to be @@ -113,7 +113,7 @@ void bb_debug_dump_packet(unsigned char *outpack, int pktsize) * Host name * IP address string * MAC address string -*/ + */ static void get_dest_addr(const char *hostid, struct ether_addr *eaddr) { struct ether_addr *eap; diff --git a/networking/ifenslave.c b/networking/ifenslave.c index f7f87bc55..c3be8180b 100644 --- a/networking/ifenslave.c +++ b/networking/ifenslave.c @@ -270,7 +270,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname) if (res < 0) { ifr.ifr_addr.sa_family = AF_INET; memset(ifr.ifr_addr.sa_data, 0, - sizeof(ifr.ifr_addr.sa_data)); + sizeof(ifr.ifr_addr.sa_data)); } res = set_ifrname_and_do_ioctl(ifra[i].s_ioctl, &ifr, slave_ifname); diff --git a/networking/interface.c b/networking/interface.c index 4b9b9485d..9ae8b3f03 100644 --- a/networking/interface.c +++ b/networking/interface.c @@ -27,7 +27,7 @@ * {1.34} - 19980630 - Arnaldo Carvalho de Melo * - gettext instead of catgets for i18n * 10/1998 - Andi Kleen. Use interface list primitives. - * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu + * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu * (default AF was wrong) */ diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index b3748e8c5..3fd3f4478 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c @@ -314,14 +314,16 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, if (rta_tb[IFA_BROADCAST]) { printf("brd %s ", rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_BROADCAST]), - abuf, sizeof(abuf))); + RTA_DATA(rta_tb[IFA_BROADCAST]), + abuf, sizeof(abuf)) + ); } if (rta_tb[IFA_ANYCAST]) { printf("any %s ", rt_addr_n2a(ifa->ifa_family, - RTA_DATA(rta_tb[IFA_ANYCAST]), - abuf, sizeof(abuf))); + RTA_DATA(rta_tb[IFA_ANYCAST]), + abuf, sizeof(abuf)) + ); } printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1)); if (ifa->ifa_flags & IFA_F_SECONDARY) { diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index dd3265c7c..241a6bf9d 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c @@ -73,15 +73,17 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, if (tb[RTA_SRC]) { if (r->rtm_src_len != host_len) { printf("%s/%u", rt_addr_n2a(r->rtm_family, - RTA_DATA(tb[RTA_SRC]), - abuf, sizeof(abuf)), + RTA_DATA(tb[RTA_SRC]), + abuf, sizeof(abuf)), r->rtm_src_len - ); + ); } else { fputs(format_host(r->rtm_family, - RTA_PAYLOAD(tb[RTA_SRC]), - RTA_DATA(tb[RTA_SRC]), - abuf, sizeof(abuf)), stdout); + RTA_PAYLOAD(tb[RTA_SRC]), + RTA_DATA(tb[RTA_SRC]), + abuf, sizeof(abuf)), + stdout + ); } } else if (r->rtm_src_len) { printf("0/%d", r->rtm_src_len); diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 5942feafc..2b651b926 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c @@ -438,7 +438,7 @@ static void print_tunnel(struct ip_tunnel_parm *p) printf(" inherit"); if (p->iph.tos & ~1) printf("%c%s ", p->iph.tos & 1 ? '/' : ' ', - rtnl_dsfield_n2a(p->iph.tos & ~1, b1)); + rtnl_dsfield_n2a(p->iph.tos & ~1, b1)); } if (!(p->iph.frag_off & htons(IP_DF))) printf(" nopmtudisc"); diff --git a/networking/netstat.c b/networking/netstat.c index 9c239579f..c0c6ba501 100644 --- a/networking/netstat.c +++ b/networking/netstat.c @@ -187,7 +187,7 @@ static void prg_cache_add(long inode, char *name) for (pnp = prg_hash + hi; (pn = *pnp) != NULL; pnp = &pn->next) { if (pn->inode == inode) { /* Some warning should be appropriate here - as we got multiple processes for one i-node */ + * as we got multiple processes for one i-node */ return; } } diff --git a/networking/route.c b/networking/route.c index 45f2be542..f662031e9 100644 --- a/networking/route.c +++ b/networking/route.c @@ -507,8 +507,8 @@ void FAST_FUNC bb_displayroutes(int noresolve, int netstatfmt) while (1) { int r; r = fscanf(fp, "%63s%lx%lx%X%d%d%d%lx%d%d%d\n", - devname, &d, &g, &flgs, &ref, &use, &metric, &m, - &mtu, &win, &ir); + devname, &d, &g, &flgs, &ref, &use, &metric, &m, + &mtu, &win, &ir); if (r != 11) { if ((r < 0) && feof(fp)) { /* EOF with no (nonspace) chars read. */ break; diff --git a/networking/tc.c b/networking/tc.c index 1574353a5..f968707a9 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -391,7 +391,7 @@ static int print_class(const struct sockaddr_nl *who UNUSED_PARAM, printf("root "); else if (msg->tcm_parent) { classid = print_tc_classid(filter_qdisc ? - TC_H_MIN(msg->tcm_parent) : msg->tcm_parent); + TC_H_MIN(msg->tcm_parent) : msg->tcm_parent); printf("parent %s ", classid); if (ENABLE_FEATURE_CLEAN_UP) free(classid); @@ -526,7 +526,8 @@ int tc_main(int argc UNUSED_PARAM, char **argv) duparg(*argv, "handle"); /* reject LONG_MIN || LONG_MAX */ /* TODO: for fw - if ((slash = strchr(handle, '/')) != NULL) + slash = strchr(handle, '/'); + if (slash != NULL) *slash = '\0'; */ msg.tcm_handle = get_u32(*argv, "handle"); diff --git a/networking/traceroute.c b/networking/traceroute.c index d197e5410..6b7b2ebdd 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -290,9 +290,10 @@ #endif -#define OPT_STRING "FIlnrdvxt:i:m:p:q:s:w:z:f:" \ - IF_FEATURE_TRACEROUTE_SOURCE_ROUTE("g:") \ - "4" IF_TRACEROUTE6("6") +#define OPT_STRING \ + "FIlnrdvxt:i:m:p:q:s:w:z:f:" \ + IF_FEATURE_TRACEROUTE_SOURCE_ROUTE("g:") \ + "4" IF_TRACEROUTE6("6") enum { OPT_DONT_FRAGMNT = (1 << 0), /* F */ OPT_USE_ICMP = (1 << 1) * ENABLE_FEATURE_TRACEROUTE_USE_ICMP, /* I */ diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index f72217c84..086228871 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -1723,7 +1723,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) #endif /* enter bound state */ timeout = lease_seconds / 2; - temp_addr.s_addr = packet.yiaddr; + temp_addr.s_addr = packet.yiaddr; bb_info_msg("Lease of %s obtained, lease time %u", inet_ntoa(temp_addr), (unsigned)lease_seconds); requested_ip = packet.yiaddr; diff --git a/procps/nmeter.c b/procps/nmeter.c index ed5479024..6a3b32743 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c @@ -271,7 +271,7 @@ static int rdval_loadavg(const char* p, ullong *vec, ...) } // Parses /proc/diskstats -// 1 2 3 4 5 6(rd) 7 8 9 10(wr) 11 12 13 14 +// 1 2 3 4 5 6(rd) 7 8 9 10(wr) 11 12 13 14 // 3 0 hda 51292 14441 841783 926052 25717 79650 843256 3029804 0 148459 3956933 // 3 1 hda1 0 0 0 0 <- ignore if only 4 fields // Linux 3.0 (maybe earlier) started printing full stats for hda1 too. diff --git a/procps/top.c b/procps/top.c index b08444a76..2908bd3e7 100644 --- a/procps/top.c +++ b/procps/top.c @@ -995,7 +995,7 @@ static unsigned handle_input(unsigned scan_mask, unsigned interval) } # if ENABLE_FEATURE_SHOW_THREADS if (c == 'h' - IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK) + IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK) ) { scan_mask ^= PSSCAN_TASKS; continue; diff --git a/runit/runsv.c b/runit/runsv.c index ad8d84f74..3e1a3c8e5 100644 --- a/runit/runsv.c +++ b/runit/runsv.c @@ -172,7 +172,7 @@ static void update_status(struct svdir *s) } close(fd); if (rename_or_warn("supervise/pid.new", - s->islog ? "log/supervise/pid" : "log/supervise/pid"+4)) + s->islog ? "log/supervise/pid" : "log/supervise/pid"+4)) return; pidchanged = 0; } diff --git a/runit/svlogd.c b/runit/svlogd.c index b0ba21bb6..b7a0a6e71 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c @@ -601,12 +601,12 @@ static int buffer_pwrite(int n, char *s, unsigned len) while (fchdir(ld->fddir) == -1) pause2cannot("change directory, want remove old logfile", - ld->name); + ld->name); oldest[0] = 'A'; oldest[1] = oldest[27] = '\0'; while (!(d = opendir("."))) pause2cannot("open directory, want remove old logfile", - ld->name); + ld->name); errno = 0; while ((f = readdir(d))) if ((f->d_name[0] == '@') && (strlen(f->d_name) == 27)) { diff --git a/selinux/chcon.c b/selinux/chcon.c index 88d0cfec6..f947c2c12 100644 --- a/selinux/chcon.c +++ b/selinux/chcon.c @@ -92,7 +92,7 @@ static int FAST_FUNC change_filedir_context( if (specified_context == NULL) { context = set_security_context_component(file_context, - user, role, type, range); + user, role, type, range); if (!context) { bb_error_msg("can't compute security context from %s", file_context); goto skip; @@ -121,15 +121,15 @@ static int FAST_FUNC change_filedir_context( } if ((option_mask32 & OPT_VERBOSE) || ((option_mask32 & OPT_CHANHES) && !fail)) { printf(!fail - ? "context of %s changed to %s\n" - : "can't change context of %s to %s\n", - fname, context_string); + ? "context of %s changed to %s\n" + : "can't change context of %s to %s\n", + fname, context_string); } if (!fail) { rc = TRUE; } else if ((option_mask32 & OPT_QUIET) == 0) { bb_error_msg("can't change context of %s to %s", - fname, context_string); + fname, context_string); } } else if (option_mask32 & OPT_VERBOSE) { printf("context of %s retained as %s\n", fname, context_string); @@ -181,7 +181,7 @@ int chcon_main(int argc UNUSED_PARAM, char **argv) #if ENABLE_FEATURE_CHCON_LONG_OPTIONS if (option_mask32 & OPT_REFERENCE) { /* FIXME: lgetfilecon() should be used when '-h' is specified. - But current implementation follows the original one. */ + * But current implementation follows the original one. */ if (getfilecon(reference_file, &specified_context) < 0) bb_perror_msg_and_die("getfilecon('%s') failed", reference_file); } else @@ -201,10 +201,10 @@ int chcon_main(int argc UNUSED_PARAM, char **argv) fname[fname_len] = '\0'; if (recursive_action(fname, - 1<num_cmds == 0 - IF_HAS_KEYWORDS( && pi->res_word == RES_NONE) + IF_HAS_KEYWORDS(&& pi->res_word == RES_NONE) ) { free_pipe_list(pi); pi = NULL; @@ -4372,7 +4372,7 @@ static struct pipe *parse_stream(char **pstring, debug_printf_parse("dest.o_assignment='%s'\n", assignment_flag[dest.o_assignment]); /* Do we sit outside of any if's, loops or case's? */ if (!HAS_KEYWORDS - IF_HAS_KEYWORDS(|| (ctx.ctx_res_w == RES_NONE && ctx.old_flag == 0)) + IF_HAS_KEYWORDS(|| (ctx.ctx_res_w == RES_NONE && ctx.old_flag == 0)) ) { o_free(&dest); #if !BB_MMU diff --git a/shell/math.c b/shell/math.c index 760645d0f..15c003965 100644 --- a/shell/math.c +++ b/shell/math.c @@ -410,7 +410,7 @@ arith_apply(arith_state_t *math_state, operator op, var_or_num_t *numstack, var_ return "exponent less than 0"; c = 1; while (--right_side_val >= 0) - c *= rez; + c *= rez; rez = c; } else if (right_side_val == 0) diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index 65e6bd7c4..ff16389bd 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c @@ -898,8 +898,7 @@ xbsd_initlabel(struct partition *p) pp->p_fstype = BSD_FS_UNUSED; #else d->d_npartitions = 3; - pp = &d->d_partitions[2]; /* Partition C should be - the whole disk */ + pp = &d->d_partitions[2]; /* Partition C should be the whole disk */ pp->p_offset = 0; pp->p_size = d->d_secperunit; pp->p_fstype = BSD_FS_UNUSED; @@ -935,7 +934,7 @@ xbsd_readlabel(struct partition *p) fdisk_fatal(unable_to_read); memmove(d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], - sizeof(struct xbsd_disklabel)); + sizeof(struct xbsd_disklabel)); if (d->d_magic != BSD_DISKMAGIC || d->d_magic2 != BSD_DISKMAGIC) return 0; diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 1508ecb03..c1d1b2cc3 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -13,7 +13,7 @@ * 10.11.91 - updated, does checking, no repairs yet. * Sent out to the mailing-list for testing. * - * 14.11.91 - Testing seems to have gone well. Added some + * 14.11.91 - Testing seems to have gone well. Added some * correction-code, and changed some functions. * * 15.11.91 - More correction code. Hopefully it notices most @@ -22,11 +22,10 @@ * 16.11.91 - More corrections (thanks to Mika Jalava). Most * things seem to work now. Yeah, sure. * - * - * 19.04.92 - Had to start over again from this old version, as a + * 19.04.92 - Had to start over again from this old version, as a * kernel bug ate my enhanced fsck in february. * - * 28.02.93 - added support for different directory entry sizes.. + * 28.02.93 - added support for different directory entry sizes.. * * Sat Mar 6 18:59:42 1993, faith@cs.unc.edu: Output namelen with * superblock information @@ -35,31 +34,31 @@ * to that required by fsutil * * Mon Jan 3 11:06:52 1994 - Dr. Wettstein (greg%wind.uucp@plains.nodak.edu) - * Added support for file system valid flag. Also - * added program_version variable and output of - * program name and version number when program - * is executed. + * Added support for file system valid flag. Also + * added program_version variable and output of + * program name and version number when program + * is executed. * - * 30.10.94 - added support for v2 filesystem - * (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de) + * 30.10.94 - added support for v2 filesystem + * (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de) * - * 10.12.94 - added test to prevent checking of mounted fs adapted - * from Theodore Ts'o's (tytso@athena.mit.edu) e2fsck - * program. (Daniel Quinlan, quinlan@yggdrasil.com) + * 10.12.94 - added test to prevent checking of mounted fs adapted + * from Theodore Ts'o's (tytso@athena.mit.edu) e2fsck + * program. (Daniel Quinlan, quinlan@yggdrasil.com) * * 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such - * for modern libcs (janl@math.uio.no, Nicolai Langfeldt) + * for modern libcs (janl@math.uio.no, Nicolai Langfeldt) * * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk * (Russell King). He made them for ARM. It would seem - * that the ARM is powerful enough to do this in C whereas + * that the ARM is powerful enough to do this in C whereas * i386 and m64k must use assembly to get it fast >:-) - * This should make minix fsck system-independent. - * (janl@math.uio.no, Nicolai Langfeldt) + * This should make minix fsck system-independent. + * (janl@math.uio.no, Nicolai Langfeldt) * * 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler * warnings. Added mc68k bitops from - * Joerg Dorchain . + * Joerg Dorchain . * * 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by * Andreas Schwab. @@ -1131,7 +1130,7 @@ static void check_counts(void) continue; } printf("Zone %d: %sin use, counted=%d\n", - i, zone_in_use(i) ? "" : "not ", zone_count[i]); + i, zone_in_use(i) ? "" : "not ", zone_count[i]); } } @@ -1183,7 +1182,7 @@ static void check_counts2(void) continue; } printf("Zone %d: %sin use, counted=%d\n", - i, zone_in_use(i) ? "" : "not ", zone_count[i]); + i, zone_in_use(i) ? "" : "not ", zone_count[i]); } } #endif @@ -1253,7 +1252,7 @@ int fsck_minix_main(int argc UNUSED_PARAM, char **argv) printf("Forcing filesystem check on %s\n", device_name); else if (OPT_repair) printf("Filesystem on %s is dirty, needs checking\n", - device_name); + device_name); read_tables(); @@ -1280,23 +1279,23 @@ int fsck_minix_main(int argc UNUSED_PARAM, char **argv) if (!inode_in_use(i)) free_cnt++; printf("\n%6u inodes used (%u%%)\n", (INODES - free_cnt), - 100 * (INODES - free_cnt) / INODES); + 100 * (INODES - free_cnt) / INODES); for (i = FIRSTZONE, free_cnt = 0; i < ZONES; i++) if (!zone_in_use(i)) free_cnt++; printf("%6u zones used (%u%%)\n\n" - "%6u regular files\n" - "%6u directories\n" - "%6u character device files\n" - "%6u block device files\n" - "%6u links\n" - "%6u symbolic links\n" - "------\n" - "%6u files\n", - (ZONES - free_cnt), 100 * (ZONES - free_cnt) / ZONES, - regular, directory, chardev, blockdev, - links - 2 * directory + 1, symlinks, - total - 2 * directory + 1); + "%6u regular files\n" + "%6u directories\n" + "%6u character device files\n" + "%6u block device files\n" + "%6u links\n" + "%6u symbolic links\n" + "------\n" + "%6u files\n", + (ZONES - free_cnt), 100 * (ZONES - free_cnt) / ZONES, + regular, directory, chardev, blockdev, + links - 2 * directory + 1, symlinks, + total - 2 * directory + 1); } if (changed) { write_tables(); diff --git a/util-linux/getopt.c b/util-linux/getopt.c index d662c813a..1ae0c59db 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c @@ -372,7 +372,7 @@ int getopt_main(int argc, char **argv) if (!argv[1]) { if (compatible) { /* For some reason, the original getopt gave no error - when there were no arguments. */ + * when there were no arguments. */ printf(" --\n"); return 0; } diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 8fdaf0b85..2668cafd4 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c @@ -152,7 +152,7 @@ static NOINLINE void do_shm(void) if ((shmctl(0, IPC_INFO, (struct shmid_ds *) (void *) &shminfo)) < 0) return; /* glibc 2.1.3 and all earlier libc's have ints as fields - of struct shminfo; glibc 2.1.91 has unsigned long; ach */ + * of struct shminfo; glibc 2.1.91 has unsigned long; ach */ printf("max number of segments = %lu\n" "max seg size (kbytes) = %lu\n" "max total shared memory (pages) = %lu\n" diff --git a/util-linux/volume_id/nilfs.c b/util-linux/volume_id/nilfs.c index ffa86d43c..b88a9e435 100644 --- a/util-linux/volume_id/nilfs.c +++ b/util-linux/volume_id/nilfs.c @@ -86,7 +86,7 @@ int FAST_FUNC volume_id_probe_nilfs(struct volume_id *id /*,uint64_t off*/) // When used it is at 4K from the end of the partition (sb->s_dev_size - NILFS_SB2_OFFSET). volume_id_set_label_string(id, sb->s_volume_name, NILFS_LABEL_SIZE < VOLUME_ID_LABEL_SIZE ? - NILFS_LABEL_SIZE : VOLUME_ID_LABEL_SIZE); + NILFS_LABEL_SIZE : VOLUME_ID_LABEL_SIZE); volume_id_set_uuid(id, sb->s_uuid, UUID_DCE); if (sb->s_rev_level == 2) diff --git a/util-linux/volume_id/ntfs.c b/util-linux/volume_id/ntfs.c index 547f141c9..7b2612f01 100644 --- a/util-linux/volume_id/ntfs.c +++ b/util-linux/volume_id/ntfs.c @@ -132,7 +132,7 @@ int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/) dbg("mft record size %i", mft_record_size); buf = volume_id_get_buffer(id, off + mft_off + (MFT_RECORD_VOLUME * mft_record_size), - mft_record_size); + mft_record_size); if (buf == NULL) goto found; @@ -165,7 +165,7 @@ int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/) break; dbg("found attribute type 0x%x, len %i, at offset %i", - attr_type, attr_len, attr_off); + attr_type, attr_len, attr_off); // if (attr_type == MFT_RECORD_ATTR_VOLUME_INFO) { // struct volume_info *info; diff --git a/util-linux/volume_id/udf.c b/util-linux/volume_id/udf.c index cd63c8d8a..d3747fb8e 100644 --- a/util-linux/volume_id/udf.c +++ b/util-linux/volume_id/udf.c @@ -109,7 +109,7 @@ nsr: return -1; dbg("vsd: %c%c%c%c%c", - vsd->id[0], vsd->id[1], vsd->id[2], vsd->id[3], vsd->id[4]); + vsd->id[0], vsd->id[1], vsd->id[2], vsd->id[3], vsd->id[4]); if (vsd->id[0] == '\0') return -1; diff --git a/util-linux/volume_id/unused_msdos.c b/util-linux/volume_id/unused_msdos.c index 65fb88501..2e8cb196a 100644 --- a/util-linux/volume_id/unused_msdos.c +++ b/util-linux/volume_id/unused_msdos.c @@ -109,7 +109,7 @@ int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t of extended = off + poff; } else { dbg("found 0x%x data partition at 0x%llx, len 0x%llx", - part[i].sys_ind, (unsigned long long) poff, (unsigned long long) plen); + part[i].sys_ind, (unsigned long long) poff, (unsigned long long) plen); // if (is_raid(part[i].sys_ind)) // volume_id_set_usage_part(p, VOLUME_ID_RAID); diff --git a/util-linux/volume_id/unused_silicon_raid.c b/util-linux/volume_id/unused_silicon_raid.c index d1c439ecf..878b88197 100644 --- a/util-linux/volume_id/unused_silicon_raid.c +++ b/util-linux/volume_id/unused_silicon_raid.c @@ -62,7 +62,7 @@ int FAST_FUNC volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t // volume_id_set_usage(id, VOLUME_ID_RAID); // snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u", -// le16_to_cpu(sil->major_ver), le16_to_cpu(sil->minor_ver)); +// le16_to_cpu(sil->major_ver), le16_to_cpu(sil->minor_ver)); // id->type = "silicon_medley_raid_member"; return 0; -- cgit v1.2.3-55-g6feb From 6830ade6aa91dad5afe6abf9d1e4f696f5641bf1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 15 Jan 2013 13:58:01 +0100 Subject: whitespace fixes. no code changes Signed-off-by: Denys Vlasenko --- console-tools/loadfont.c | 2 +- coreutils/cal.c | 4 ++-- coreutils/chown.c | 4 ++-- coreutils/df.c | 4 ++-- coreutils/sort.c | 2 +- coreutils/sum.c | 4 ++-- editors/sed.c | 2 +- editors/vi.c | 10 +++++----- include/bb_archive.h | 6 +++--- include/grp_.h | 24 ++++++++++++------------ include/libbb.h | 2 +- include/pwd_.h | 24 ++++++++++++------------ include/shadow_.h | 14 +++++++------- libbb/xatonum_template.c | 2 +- miscutils/devfsd.c | 30 +++++++++++++++--------------- miscutils/hdparm.c | 2 +- miscutils/less.c | 6 +++--- miscutils/rx.c | 4 ++-- miscutils/time.c | 2 +- shell/hush.c | 2 +- 20 files changed, 75 insertions(+), 75 deletions(-) (limited to 'miscutils') diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 9e887f256..032506d6d 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -229,7 +229,7 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize, } /* Note: after PIO_UNIMAPCLR and before PIO_UNIMAP - this printf did not work on many kernels */ + * this printf did not work on many kernels */ advice.advised_hashsize = 0; advice.advised_hashstep = 0; diff --git a/coreutils/cal.c b/coreutils/cal.c index 0b2307349..0d388aa1c 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c @@ -43,7 +43,7 @@ static const unsigned char days_in_month[] ALIGN1 = { }; static const unsigned char sep1752[] ALIGN1 = { - 1, 2, 14, 15, 16, + 1, 2, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 }; @@ -183,7 +183,7 @@ int cal_main(int argc UNUSED_PARAM, char **argv) center(lineout, (WEEK_LEN * 3 + HEAD_SEP * 2) + julian * (J_WEEK_LEN * 2 + HEAD_SEP - - (WEEK_LEN * 3 + HEAD_SEP * 2)), + - (WEEK_LEN * 3 + HEAD_SEP * 2)), 0 ); puts("\n"); /* two \n's */ diff --git a/coreutils/chown.c b/coreutils/chown.c index bb166d8fe..1a9127622 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -126,8 +126,8 @@ int chown_main(int argc UNUSED_PARAM, char **argv) /* This matches coreutils behavior (almost - see below) */ param.chown_func = chown; if (OPT_NODEREF - /* || (OPT_RECURSE && !OPT_TRAVERSE_TOP): */ - IF_DESKTOP( || (opt & (BIT_RECURSE|BIT_TRAVERSE_TOP)) == BIT_RECURSE) + /* || (OPT_RECURSE && !OPT_TRAVERSE_TOP): */ + IF_DESKTOP( || (opt & (BIT_RECURSE|BIT_TRAVERSE_TOP)) == BIT_RECURSE) ) { param.chown_func = lchown; } diff --git a/coreutils/df.c b/coreutils/df.c index 2c72e82a4..5e9a8670f 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -110,8 +110,8 @@ int df_main(int argc UNUSED_PARAM, char **argv) df_disp_hr = xatoul_range(chp, 1, ULONG_MAX); /* disallow 0 */ /* From the manpage of df from coreutils-6.10: - Disk space is shown in 1K blocks by default, unless the environment - variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. + * Disk space is shown in 1K blocks by default, unless the environment + * variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used. */ if (getenv("POSIXLY_CORRECT")) /* TODO - a new libbb function? */ df_disp_hr = 512; diff --git a/coreutils/sort.c b/coreutils/sort.c index 1df07285c..a1625fc9c 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -219,7 +219,7 @@ static int compare_keys(const void *xarg, const void *yarg) y = get_key(*(char **)yarg, key, flags); #else /* This curly bracket serves no purpose but to match the nesting - level of the for () loop we're not using */ + * level of the for () loop we're not using */ { x = *(char **)xarg; y = *(char **)yarg; diff --git a/coreutils/sum.c b/coreutils/sum.c index 95110a6da..75f6ef60a 100644 --- a/coreutils/sum.c +++ b/coreutils/sum.c @@ -94,8 +94,8 @@ int sum_main(int argc UNUSED_PARAM, char **argv) n = sum_file("-", type); } else { /* Need to print the name if either - - more than one file given - - doing sysv */ + * - more than one file given + * - doing sysv */ type += (argv[1] || type == SUM_SYSV); n = 1; do { diff --git a/editors/sed.c b/editors/sed.c index 070af611a..f8ca5d351 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -1077,7 +1077,7 @@ static void process_files(void) /* or does this line matches our last address regex */ || (sed_cmd->end_match && old_matched && (regexec(sed_cmd->end_match, - pattern_space, 0, NULL, 0) == 0) + pattern_space, 0, NULL, 0) == 0) ) ); } diff --git a/editors/vi.c b/editors/vi.c index b1776c668..5b5e2b0bf 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -1929,11 +1929,11 @@ static int find_range(char **start, char **stop, char c) dot_end(); // find NL q = dot; } else { - // nothing -- this causes any other values of c to - // represent the one-character range under the - // cursor. this is correct for ' ' and 'l', but - // perhaps no others. - // + // nothing -- this causes any other values of c to + // represent the one-character range under the + // cursor. this is correct for ' ' and 'l', but + // perhaps no others. + // } if (q < p) { t = q; diff --git a/include/bb_archive.h b/include/bb_archive.h index 7bb5615da..a7a2a1135 100644 --- a/include/bb_archive.h +++ b/include/bb_archive.h @@ -220,9 +220,9 @@ IF_DESKTOP(long long) int unpack_xz_stream(transformer_aux_data_t *aux, int src_ char* append_ext(char *filename, const char *expected_ext) FAST_FUNC; int bbunpack(char **argv, - IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux), - char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext), - const char *expected_ext + IF_DESKTOP(long long) int FAST_FUNC (*unpacker)(transformer_aux_data_t *aux), + char* FAST_FUNC (*make_new_name)(char *filename, const char *expected_ext), + const char *expected_ext ) FAST_FUNC; void check_errors_in_children(int signo); diff --git a/include/grp_.h b/include/grp_.h index 82ad90492..e5075e5a0 100644 --- a/include/grp_.h +++ b/include/grp_.h @@ -64,7 +64,7 @@ extern struct group *fgetgrent(FILE *__stream); /* Write the given entry onto the given stream. */ extern int putgrent(const struct group *__restrict __p, - FILE *__restrict __f); + FILE *__restrict __f); #endif /* Search for an entry with a matching group ID. */ @@ -82,32 +82,32 @@ extern struct group *getgrnam(const char *__name); POSIX people would choose. */ extern int getgrent_r(struct group *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result); + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); /* Search for an entry with a matching group ID. */ extern int getgrgid_r(gid_t __gid, struct group *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result); + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); /* Search for an entry with a matching group name. */ extern int getgrnam_r(const char *__restrict __name, - struct group *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result); + struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); /* Read a group entry from STREAM. This function is not standardized an probably never will. */ extern int fgetgrent_r(FILE *__restrict __stream, - struct group *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct group **__restrict __result); + struct group *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct group **__restrict __result); /* Store at most *NGROUPS members of the group set for USER into *GROUPS. Also include GROUP. The actual number of groups found is returned in *NGROUPS. Return -1 if the if *NGROUPS is too small. */ extern int getgrouplist(const char *__user, gid_t __group, - gid_t *__groups, int *__ngroups); + gid_t *__groups, int *__ngroups); /* Initialize the group set for the current user by reading the group database and using all groups diff --git a/include/libbb.h b/include/libbb.h index 6ac7d2cab..606db7d0d 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1516,7 +1516,7 @@ struct smaprec { procps_read_smaps(pid, total) #endif int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, - void (*cb)(struct smaprec *, void *), void *data); + void (*cb)(struct smaprec *, void *), void *data); typedef struct procps_status_t { DIR *dir; diff --git a/include/pwd_.h b/include/pwd_.h index ea158da45..625b6f5a2 100644 --- a/include/pwd_.h +++ b/include/pwd_.h @@ -63,7 +63,7 @@ extern struct passwd *fgetpwent(FILE *__stream); /* Write the given entry onto the given stream. */ extern int putpwent(const struct passwd *__restrict __p, - FILE *__restrict __f); + FILE *__restrict __f); #endif /* Search for an entry with a matching user ID. */ @@ -81,25 +81,25 @@ extern struct passwd *getpwnam(const char *__name); POSIX people would choose. */ extern int getpwent_r(struct passwd *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result); + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); extern int getpwuid_r(uid_t __uid, - struct passwd *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result); + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); extern int getpwnam_r(const char *__restrict __name, - struct passwd *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result); + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); /* Read an entry from STREAM. This function is not standardized and probably never will. */ extern int fgetpwent_r(FILE *__restrict __stream, - struct passwd *__restrict __resultbuf, - char *__restrict __buffer, size_t __buflen, - struct passwd **__restrict __result); + struct passwd *__restrict __resultbuf, + char *__restrict __buffer, size_t __buflen, + struct passwd **__restrict __result); POP_SAVED_FUNCTION_VISIBILITY diff --git a/include/shadow_.h b/include/shadow_.h index 648a62ab3..7babe4f30 100644 --- a/include/shadow_.h +++ b/include/shadow_.h @@ -79,21 +79,21 @@ extern int putspent(const struct spwd *__p, FILE *__stream); /* Reentrant versions of some of the functions above */ extern int getspent_r(struct spwd *__result_buf, char *__buffer, - size_t __buflen, struct spwd **__result); + size_t __buflen, struct spwd **__result); #endif extern int getspnam_r(const char *__name, struct spwd *__result_buf, - char *__buffer, size_t __buflen, - struct spwd **__result); + char *__buffer, size_t __buflen, + struct spwd **__result); #ifdef UNUSED_FOR_NOW extern int sgetspent_r(const char *__string, struct spwd *__result_buf, - char *__buffer, size_t __buflen, - struct spwd **__result); + char *__buffer, size_t __buflen, + struct spwd **__result); extern int fgetspent_r(FILE *__stream, struct spwd *__result_buf, - char *__buffer, size_t __buflen, - struct spwd **__result); + char *__buffer, size_t __buflen, + struct spwd **__result); /* Protect password file against multi writers */ extern int lckpwdf(void); diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c index 029f66202..e0471983c 100644 --- a/libbb/xatonum_template.c +++ b/libbb/xatonum_template.c @@ -59,7 +59,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base, } /* Note: trailing space is an error. - It would be easy enough to allow though if desired. */ + * It would be easy enough to allow though if desired. */ if (*e) goto inval; chk_range: diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index 2e87261cf..24c953bac 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -803,8 +803,8 @@ static void action_execute(const struct devfsd_notify_struct *info, static void action_copy(const struct devfsd_notify_struct *info, - const struct config_entry_struct *entry, - const regmatch_t *regexpr, unsigned int numexpr) + const struct config_entry_struct *entry, + const regmatch_t *regexpr, unsigned int numexpr) /* [SUMMARY] Copy permissions. The devfs change. The config file entry. @@ -1259,11 +1259,11 @@ static int make_dir_tree(const char *path) } /* End Function make_dir_tree */ static int expand_expression(char *output, unsigned int outsize, - const char *input, - const char *(*get_variable_func)(const char *variable, void *info), - void *info, - const char *devname, - const regmatch_t *ex, unsigned int numexp) + const char *input, + const char *(*get_variable_func)(const char *variable, void *info), + void *info, + const char *devname, + const regmatch_t *ex, unsigned int numexp) /* [SUMMARY] Expand environment variables and regular subexpressions in string. The output expanded expression is written here. The size of the output buffer. @@ -1288,8 +1288,8 @@ static int expand_expression(char *output, unsigned int outsize, } /* End Function expand_expression */ static void expand_regexp(char *output, size_t outsize, const char *input, - const char *devname, - const regmatch_t *ex, unsigned int numex) + const char *devname, + const regmatch_t *ex, unsigned int numex) /* [SUMMARY] Expand all occurrences of the regular subexpressions \0 to \9. The output expanded expression is written here. The size of the output buffer. @@ -1385,7 +1385,7 @@ static struct translate_struct translate_table[] = }; const char *get_old_name(const char *devname, unsigned int namelen, - char *buffer, unsigned int major, unsigned int minor) + char *buffer, unsigned int major, unsigned int minor) /* [SUMMARY] Translate a kernel-supplied name into an old name. The device name provided by the kernel. The length of the name. @@ -1423,7 +1423,7 @@ const char *get_old_name(const char *devname, unsigned int namelen, }; for (trans = translate_table; trans->match != NULL; ++trans) { - len = strlen(trans->match); + len = strlen(trans->match); if (strncmp(devname, trans->match, len) == 0) { if (trans->format == NULL) @@ -1549,9 +1549,9 @@ static char *write_old_sd_name(char *buffer, /*EXPERIMENTAL_FUNCTION*/ int st_expr_expand(char *output, unsigned int length, const char *input, - const char *(*get_variable_func)(const char *variable, - void *info), - void *info) + const char *(*get_variable_func)(const char *variable, + void *info), + void *info) /* [SUMMARY] Expand an expression using Borne Shell-like unquoted rules. The output expanded expression is written here. The size of the output buffer. @@ -1643,7 +1643,7 @@ st_expr_expand_out: static const char *expand_variable(char *buffer, unsigned int length, unsigned int *out_pos, const char *input, const char *(*func)(const char *variable, - void *info), + void *info), void *info) /* [SUMMARY] Expand a variable. The buffer to write to. diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index 9c6dbf468..69726ae72 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c @@ -1038,7 +1038,7 @@ static void identify(uint16_t *val) val[ACOUSTIC] & 0x00ff); } } else { - /* ATAPI */ + /* ATAPI */ if (eqpt != CDROM && (val[CAPAB_0] & SWRST_REQ)) printf("\tATA sw reset required\n"); diff --git a/miscutils/less.c b/miscutils/less.c index f0187bf8a..5ce0a1203 100644 --- a/miscutils/less.c +++ b/miscutils/less.c @@ -709,9 +709,9 @@ static void print_found(const char *line) /* buf[] holds quarantined version of str */ /* Each part of the line that matches has the HIGHLIGHT - and NORMAL escape sequences placed around it. - NB: we regex against line, but insert text - from quarantined copy (buf[]) */ + * and NORMAL escape sequences placed around it. + * NB: we regex against line, but insert text + * from quarantined copy (buf[]) */ str = buf; growline = NULL; eflags = 0; diff --git a/miscutils/rx.c b/miscutils/rx.c index af597320c..1dffb593a 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -193,8 +193,8 @@ static int receive(/*int read_fd, */int file_fd) } if (cksum_or_crc != expected) { bb_error_msg(do_crc ? "crc error, expected 0x%04x, got 0x%04x" - : "checksum error, expected 0x%02x, got 0x%02x", - expected, cksum_or_crc); + : "checksum error, expected 0x%02x, got 0x%02x", + expected, cksum_or_crc); goto error; } diff --git a/miscutils/time.c b/miscutils/time.c index ffed38632..19b0b44c9 100644 --- a/miscutils/time.c +++ b/miscutils/time.c @@ -70,7 +70,7 @@ static void resuse_end(pid_t pid, resource_t *resp) pid_t caught; /* Ignore signals, but don't ignore the children. When wait3 - returns the child process, set the time the command finished. */ + * returns the child process, set the time the command finished. */ while ((caught = wait3(&resp->waitstatus, 0, &resp->ru)) != pid) { if (caught == -1 && errno != EINTR) { bb_perror_msg("wait"); diff --git a/shell/hush.c b/shell/hush.c index 87807052c..e2dc1e2d0 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -8281,7 +8281,7 @@ static int FAST_FUNC builtin_exit(char **argv) * (if there are _stopped_ jobs, running ones don't count) * # exit * exit - # EEE (then bash exits) + * EEE (then bash exits) * * TODO: we can use G.exiting = -1 as indicator "last cmd was exit" */ -- cgit v1.2.3-55-g6feb From 9daf33fc5245abebdda145f95e1ad3a175241f18 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 18 Jan 2013 13:30:13 +0100 Subject: dc: code shrink function old new delta stack_machine 103 101 -2 operators 176 168 -8 Signed-off-by: Denys Vlasenko --- miscutils/dc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'miscutils') diff --git a/miscutils/dc.c b/miscutils/dc.c index 6903761e4..6bcfbe249 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -11,11 +11,11 @@ //usage: //usage:#define dc_full_usage "\n\n" //usage: "Tiny RPN calculator. Operations:\n" -//usage: "+, add, -, sub, *, mul, /, div, %, mod, "IF_FEATURE_DC_LIBM("**, exp, ")"and, or, not, eor,\n" +//usage: "+, add, -, sub, *, mul, /, div, %, mod, "IF_FEATURE_DC_LIBM("**, exp, ")"and, or, not, xor,\n" //usage: "p - print top of the stack (without popping),\n" //usage: "f - print entire stack,\n" //usage: "o - pop the value and set output radix (must be 10, 16, 8 or 2).\n" -//usage: "Examples: 'dc 2 2 add p' -> 4, 'dc 8 8 * 2 2 + / p' -> 16" +//usage: "Examples: 'dc 2 2 add p' -> 4, 'dc 8 8 mul 2 2 + / p' -> 16" //usage: //usage:#define dc_example_usage //usage: "$ dc 2 2 + p\n" @@ -219,29 +219,29 @@ static const struct op operators[] = { {"p", print_no_pop}, {"f", print_stack_no_pop}, {"o", set_output_base}, - { "", NULL } }; static void stack_machine(const char *argument) { - char *endPointer; + char *end; double d; - const struct op *o = operators; + const struct op *o; - d = strtod(argument, &endPointer); - - if (endPointer != argument && *endPointer == '\0') { + d = strtod(argument, &end); + if (end != argument && *end == '\0') { push(d); return; } - while (o->function) { + o = operators; + do { if (strcmp(o->name, argument) == 0) { o->function(); return; } o++; - } + } while (o != operators + ARRAY_SIZE(operators)); + bb_error_msg_and_die("syntax error at '%s'", argument); } -- cgit v1.2.3-55-g6feb From 243e7330015e748b898c4c8692909fa18bd57463 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 23 Jan 2013 11:41:22 +0100 Subject: flashcp: pad output to BUFSIZE. Hopefully closes 5882 Signed-off-by: Denys Vlasenko --- miscutils/flashcp.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'miscutils') diff --git a/miscutils/flashcp.c b/miscutils/flashcp.c index 81cde9072..36b6efe1e 100644 --- a/miscutils/flashcp.c +++ b/miscutils/flashcp.c @@ -16,6 +16,7 @@ #include "libbb.h" #include +/* If 1, simulates "flashing" by writing to existing regular file */ #define MTD_DEBUG 0 #define OPT_v (1 << 0) @@ -32,7 +33,7 @@ static void progress(int mode, uoff_t count, uoff_t total) if (total) percent = (unsigned) (percent / total); printf("\r%s: %"OFF_FMT"u/%"OFF_FMT"u (%u%%) ", - (mode == 0) ? "Erasing block" : ((mode == 1) ? "Writing kb" : "Verifying kb"), + (mode == -1) ? "Erasing block" : ((mode == 0) ? "Writing kb" : "Verifying kb"), count, total, (unsigned)percent); fflush_all(); } @@ -97,8 +98,7 @@ int flashcp_main(int argc UNUSED_PARAM, char **argv) #endif e.start = 0; for (i = 1; i <= erase_count; i++) { - progress(0, i, erase_count); - errno = 0; + progress(-1, i, erase_count); #if !MTD_DEBUG if (ioctl(fd_d, MEMERASE, &e) < 0) { bb_perror_msg_and_die("erase error at 0x%llx on %s", @@ -113,7 +113,7 @@ int flashcp_main(int argc UNUSED_PARAM, char **argv) /* doing this outer loop gives significantly smaller code * than doing two separate loops for writing and verifying */ - for (i = 1; i <= 2; i++) { + for (i = 0; i <= 1; i++) { uoff_t done; unsigned count; @@ -122,25 +122,29 @@ int flashcp_main(int argc UNUSED_PARAM, char **argv) done = 0; count = BUFSIZE; while (1) { - uoff_t rem = statb.st_size - done; + uoff_t rem; + + progress(i, done / 1024, (uoff_t)statb.st_size / 1024); + rem = statb.st_size - done; if (rem == 0) break; if (rem < BUFSIZE) count = rem; - progress(i, done / 1024, (uoff_t)statb.st_size / 1024); xread(fd_f, buf, count); - if (i == 1) { + if (i == 0) { int ret; + if (count < BUFSIZE) + memset((char*)buf + count, 0, BUFSIZE - count); errno = 0; - ret = full_write(fd_d, buf, count); - if (ret != count) { + ret = full_write(fd_d, buf, BUFSIZE); + if (ret != BUFSIZE) { bb_perror_msg_and_die("write error at 0x%"OFF_FMT"x on %s, " "write returned %d", done, devicename, ret); } - } else { /* i == 2 */ + } else { /* i == 1 */ xread(fd_d, buf2, count); - if (memcmp(buf, buf2, count)) { + if (memcmp(buf, buf2, count) != 0) { bb_error_msg_and_die("verification mismatch at 0x%"OFF_FMT"x", done); } } -- cgit v1.2.3-55-g6feb From 6be6f3bfecf436b03fe9b84b2aedbe8c938a8996 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 28 Jan 2013 12:26:29 +0100 Subject: flashcp: trivial code shrink Signed-off-by: Denys Vlasenko --- miscutils/flashcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'miscutils') diff --git a/miscutils/flashcp.c b/miscutils/flashcp.c index 36b6efe1e..b526566a4 100644 --- a/miscutils/flashcp.c +++ b/miscutils/flashcp.c @@ -33,7 +33,7 @@ static void progress(int mode, uoff_t count, uoff_t total) if (total) percent = (unsigned) (percent / total); printf("\r%s: %"OFF_FMT"u/%"OFF_FMT"u (%u%%) ", - (mode == -1) ? "Erasing block" : ((mode == 0) ? "Writing kb" : "Verifying kb"), + (mode < 0) ? "Erasing block" : ((mode == 0) ? "Writing kb" : "Verifying kb"), count, total, (unsigned)percent); fflush_all(); } -- cgit v1.2.3-55-g6feb