*: whitespace fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-10-28 18:57:19 +02:00
parent 7765095441
commit e4dcba1c10
82 changed files with 185 additions and 183 deletions

View File

@ -866,7 +866,7 @@ static void write_status_file(deb_file_t **deb_file)
write_flag = TRUE;
fputs("\n", new_status_file);
}
else if (strcmp("config-files", name_hashtable[state_status]) == 0) {
else if (strcmp("config-files", name_hashtable[state_status]) == 0) {
/* only change the status line */
while (1) {
char *field_name;

View File

@ -68,7 +68,7 @@ aa: 85.1% -- replaced with aa.gz
*/
#define SMALL_MEM
#ifndef INBUFSIZ
#ifndef INBUFSIZ
# ifdef SMALL_MEM
# define INBUFSIZ 0x2000 /* input buffer size */
# else
@ -76,7 +76,7 @@ aa: 85.1% -- replaced with aa.gz
# endif
#endif
#ifndef OUTBUFSIZ
#ifndef OUTBUFSIZ
# ifdef SMALL_MEM
# define OUTBUFSIZ 8192 /* output buffer size */
# else

View File

@ -29,10 +29,10 @@
/* Default input buffer size */
#define IBUFSIZ 2048
#define IBUFSIZ 2048
/* Default output buffer size */
#define OBUFSIZ 2048
#define OBUFSIZ 2048
/* Defines for third byte of header */
#define BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */

View File

@ -3,7 +3,7 @@
* env implementation for busybox
*
* Copyright (c) 1988, 1993, 1994
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
@ -103,8 +103,8 @@ int env_main(int argc UNUSED_PARAM, char **argv)
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
* 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
*
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software

View File

@ -18,9 +18,9 @@ enum {
HASH_SHA512 = '5',
};
#define FLAG_SILENT 1
#define FLAG_CHECK 2
#define FLAG_WARN 4
#define FLAG_SILENT 1
#define FLAG_CHECK 2
#define FLAG_WARN 4
/* This might be useful elsewhere */
static unsigned char *hash_bin_to_hex(unsigned char *hash_value,

View File

@ -30,7 +30,7 @@ int mkfifo_main(int argc UNUSED_PARAM, char **argv)
do {
if (mkfifo(*argv, mode) < 0) {
bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
bb_simple_perror_msg(*argv); /* Avoid multibyte problems. */
retval = EXIT_FAILURE;
}
} while (*++argv);

View File

@ -110,7 +110,7 @@ odoffset(dumper_t *dumper, int argc, char ***argvp)
* the offset is changed as well. This isn't pretty,
* but it's easy.
*/
#define TYPE_OFFSET 7
#define TYPE_OFFSET 7
{
char x_or_d;
if (base == 16) {
@ -130,19 +130,19 @@ odoffset(dumper_t *dumper, int argc, char ***argvp)
}
static const char *const add_strings[] = {
"16/1 \"%3_u \" \"\\n\"", /* a */
"8/2 \" %06o \" \"\\n\"", /* B, o */
"16/1 \"%03o \" \"\\n\"", /* b */
"16/1 \"%3_c \" \"\\n\"", /* c */
"8/2 \" %05u \" \"\\n\"", /* d */
"4/4 \" %010u \" \"\\n\"", /* D */
"2/8 \" %21.14e \" \"\\n\"", /* e (undocumented in od), F */
"4/4 \" %14.7e \" \"\\n\"", /* f */
"4/4 \" %08x \" \"\\n\"", /* H, X */
"8/2 \" %04x \" \"\\n\"", /* h, x */
"4/4 \" %11d \" \"\\n\"", /* I, L, l */
"8/2 \" %6d \" \"\\n\"", /* i */
"4/4 \" %011o \" \"\\n\"", /* O */
"16/1 \"%3_u \" \"\\n\"", /* a */
"8/2 \" %06o \" \"\\n\"", /* B, o */
"16/1 \"%03o \" \"\\n\"", /* b */
"16/1 \"%3_c \" \"\\n\"", /* c */
"8/2 \" %05u \" \"\\n\"", /* d */
"4/4 \" %010u \" \"\\n\"", /* D */
"2/8 \" %21.14e \" \"\\n\"", /* e (undocumented in od), F */
"4/4 \" %14.7e \" \"\\n\"", /* f */
"4/4 \" %08x \" \"\\n\"", /* H, X */
"8/2 \" %04x \" \"\\n\"", /* h, x */
"4/4 \" %11d \" \"\\n\"", /* I, L, l */
"8/2 \" %6d \" \"\\n\"", /* i */
"4/4 \" %011o \" \"\\n\"", /* O */
};
static const char od_opts[] ALIGN1 = "aBbcDdeFfHhIiLlOoXxv";

View File

@ -50,7 +50,7 @@ int rmdir_main(int argc UNUSED_PARAM, char **argv)
if ((flags & IGNORE_NON_EMPTY) && errno == ENOTEMPTY)
break;
#endif
bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */
bb_perror_msg("'%s'", path); /* Match gnu rmdir msg. */
status = EXIT_FAILURE;
} else if (flags & PARENTS) {
/* Note: path was not "" since rmdir succeeded. */

View File

@ -469,7 +469,7 @@ static bool do_statfs(const char *filename, const char *format)
if (scontext)
freecon(scontext);
# endif
#endif /* FEATURE_STAT_FORMAT */
#endif /* FEATURE_STAT_FORMAT */
return 1;
}
@ -635,7 +635,7 @@ static bool do_stat(const char *filename, const char *format)
human_time(statbuf.st_mtime),
human_time(statbuf.st_ctime));
}
#endif /* FEATURE_STAT_FORMAT */
#endif /* FEATURE_STAT_FORMAT */
return 1;
}

View File

@ -1110,16 +1110,16 @@ static void set_mode(const struct mode_info *info, int reversed,
if (reversed)
mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8;
else
mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7;
mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7;
} else if (info == &mode_info[IDX_oddp]) {
if (reversed)
mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8;
else
mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB;
mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB;
} else if (info == &mode_info[IDX_nl]) {
if (reversed) {
mode->c_iflag = (mode->c_iflag | ICRNL) & ~INLCR & ~IGNCR;
mode->c_oflag = (mode->c_oflag | ONLCR) & ~OCRNL & ~ONLRET;
mode->c_oflag = (mode->c_oflag | ONLCR) & ~OCRNL & ~ONLRET;
} else {
mode->c_iflag = mode->c_iflag & ~ICRNL;
if (ONLCR) mode->c_oflag = mode->c_oflag & ~ONLCR;

View File

@ -97,7 +97,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
parse_datestr(date_str, &tm_time);
/* Correct any day of week and day of year etc. fields */
tm_time.tm_isdst = -1; /* Be sure to recheck dst */
tm_time.tm_isdst = -1; /* Be sure to recheck dst */
t = validate_tm_time(date_str, &tm_time);
timebuf[1].tv_sec = timebuf[0].tv_sec = t;

View File

@ -16,10 +16,10 @@ int tty_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int tty_main(int argc UNUSED_PARAM, char **argv)
{
const char *s;
IF_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */
IF_INCLUDE_SUSv2(int silent;) /* Note: No longer relevant in SUSv3. */
int retval;
xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */
xfunc_error_retval = 2; /* SUSv3 requires > 1 for error. */
IF_INCLUDE_SUSv2(silent = getopt32(argv, "s");)
IF_INCLUDE_SUSv2(argv += optind;)

View File

@ -86,7 +86,7 @@ int uniq_main(int argc UNUSED_PARAM, char **argv)
}
free(cur_line);
++dups; /* testing for overflow seems excessive */
++dups; /* testing for overflow seems excessive */
}
if (old_line) {

View File

@ -65,7 +65,7 @@ int ext2fs_test_bit(unsigned int nr, const void * addr)
return (mask & *ADDR);
}
#endif /* !_EXT2_HAVE_ASM_BITOPS_ */
#endif /* !_EXT2_HAVE_ASM_BITOPS_ */
void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
const char *description)

View File

@ -23,7 +23,7 @@
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/param.h>
#include <sys/mount.h> /* This may define BLKFLSBUF */
#include <sys/mount.h> /* This may define BLKFLSBUF */
#endif
#include "ext2_fs.h"
@ -38,10 +38,10 @@
*/
#ifdef __linux__
#ifndef BLKFLSBUF
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
#endif
#ifndef FDFLUSH
#define FDFLUSH _IO(2,0x4b) /* flush floppy disk */
#define FDFLUSH _IO(2,0x4b) /* flush floppy disk */
#endif
#endif

View File

@ -1,8 +1,8 @@
/* vi: set sw=4 ts=4: */
/*
* inline.c --- Includes the inlined functions defined in the header
* files as standalone functions, in case the application program
* is compiled with inlining turned off.
* files as standalone functions, in case the application program
* is compiled with inlining turned off.
*
* Copyright (C) 1993, 1994 Theodore Ts'o.
*

View File

@ -59,7 +59,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
if (S_ISBLK(st_buf.st_mode)) {
#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
#endif /* __GNU__ */
#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@ -73,7 +73,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
#ifndef __GNU__
if (file_rdev && (file_rdev == st_buf.st_rdev))
break;
#endif /* __GNU__ */
#endif /* __GNU__ */
} else {
if (file_dev && ((file_dev == st_buf.st_dev) &&
(file_ino == st_buf.st_ino)))
@ -99,7 +99,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
goto is_root;
}
}
#endif /* __GNU__ */
#endif /* __GNU__ */
goto errout;
}
#ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */
@ -247,7 +247,7 @@ static int is_swap_device(const char *file)
if ((stat(file, &st_buf) == 0) &&
S_ISBLK(st_buf.st_mode))
file_dev = st_buf.st_rdev;
#endif /* __GNU__ */
#endif /* __GNU__ */
if (!(f = fopen_for_read("/proc/swaps")))
return 0;
@ -271,7 +271,7 @@ static int is_swap_device(const char *file)
ret++;
break;
}
#endif /* __GNU__ */
#endif /* __GNU__ */
}
fclose(f);
return ret;

View File

@ -12,10 +12,10 @@
/*
* History:
* 93/10/30 - Creation
* 93/11/13 - Replace stat() calls by lstat() to avoid loops
* 94/02/27 - Integrated in Ted's distribution
* 98/12/29 - Display version info only when -V specified (G M Sipe)
* 93/10/30 - Creation
* 93/11/13 - Replace stat() calls by lstat() to avoid loops
* 94/02/27 - Integrated in Ted's distribution
* 98/12/29 - Display version info only when -V specified (G M Sipe)
*/
#include <sys/types.h>

View File

@ -43,7 +43,7 @@ do { \
//usage: "Adjust filesystem options on ext[23] filesystems"
enum {
OPT_L = 1 << 0, // label
OPT_L = 1 << 0, // label
OPT_c = 1 << 1, // max mount count
OPT_i = 1 << 2, // check interval
};

View File

@ -45,7 +45,7 @@ typedef struct FS { /* format strings */
typedef struct dumper_t {
off_t dump_skip; /* bytes to skip */
int dump_length; /* max bytes to read */
smallint dump_vflag; /*enum dump_vflag_t*/
smallint dump_vflag; /*enum dump_vflag_t*/
FS *fshead;
} dumper_t;

View File

@ -220,11 +220,11 @@ typedef unsigned long uoff_t;
/* Macros for min/max. */
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
/* buffer allocation schemes */

View File

@ -4,7 +4,7 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#ifndef BB_PLATFORM_H
#ifndef BB_PLATFORM_H
#define BB_PLATFORM_H 1
/* Assume all these functions exist by default. Platforms where it is not

View File

@ -28,9 +28,9 @@
#include "libbb.h"
#ifdef USE_TTY_GROUP
#define S_IWGRP_OR_S_IWOTH S_IWGRP
#define S_IWGRP_OR_S_IWOTH S_IWGRP
#else
#define S_IWGRP_OR_S_IWOTH (S_IWGRP | S_IWOTH)
#define S_IWGRP_OR_S_IWOTH (S_IWGRP | S_IWOTH)
#endif
int mesg_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;

View File

@ -4,7 +4,7 @@
* based on code from util-linux v 2.11l
*
* Copyright (c) 1989
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
@ -208,7 +208,7 @@ static NOINLINE void rewrite(priv_dumper_t *dumper, FS *fs)
pr->bcnt = fu->bcnt;
} else if (sokay == USEPREC) {
pr->bcnt = prec;
} else { /* NOTOKAY */
} else { /* NOTOKAY */
bb_error_msg_and_die("%%s requires a precision or a byte count");
}
} else if (*p1 == '_') {
@ -467,7 +467,7 @@ static void bpad(PR *pr)
static const char conv_str[] ALIGN1 =
"\0\\0\0"
"\007\\a\0" /* \a */
"\007\\a\0" /* \a */
"\b\\b\0"
"\f\\b\0"
"\n\\n\0"

View File

@ -30,7 +30,7 @@ ssize_t FAST_FUNC full_write(int fd, const void *buf, size_t len)
/* user can do another write to know the error code */
return total;
}
return cc; /* write() returns -1 on failure. */
return cc; /* write() returns -1 on failure. */
}
total += cc;

View File

@ -53,8 +53,8 @@ const char* FAST_FUNC make_human_readable_str(unsigned long long val,
u = unit_chars;
if (display_unit) {
val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above! */
val += display_unit/2; /* Deal with rounding */
val /= display_unit; /* Don't combine with the line above! */
/* will just print it as ulonglong (below) */
} else {
while ((val >= 1024)

View File

@ -218,4 +218,4 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
return xstrdup(name);
}
#endif /* CONFIG_FEATURE_IPV6 */
#endif /* CONFIG_FEATURE_IPV6 */

View File

@ -17,8 +17,8 @@ typedef struct ino_dev_hash_bucket_struct {
char name[1];
} ino_dev_hashtable_bucket_t;
#define HASH_SIZE 311 /* Should be prime */
#define hash_inode(i) ((i) % HASH_SIZE)
#define HASH_SIZE 311 /* Should be prime */
#define hash_inode(i) ((i) % HASH_SIZE)
/* array of [HASH_SIZE] elements */
static ino_dev_hashtable_bucket_t **ino_dev_hashtable;

View File

@ -30,7 +30,7 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty)
time(&t);
uname(&uts);
puts("\r"); /* start a new line */
puts("\r"); /* start a new line */
fp = fopen_for_read(issue_file);
if (!fp)

View File

@ -44,7 +44,7 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
while (1) {
c = '\0';
if (flags & FILEUTILS_RECUR) { /* Get the parent */
if (flags & FILEUTILS_RECUR) { /* Get the parent */
/* Bypass leading non-'/'s and then subsequent '/'s */
while (*s) {
if (*s == '/') {

View File

@ -45,7 +45,7 @@ int parse_main(int argc UNUSED_PARAM, char **argv)
Typical usage:
----- CUT -----
char *t[3]; // tokens placeholder
char *t[3]; // tokens placeholder
parser_t *p = config_open(filename);
if (p) {
// parse line-by-line

View File

@ -57,8 +57,8 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
/* Note: we allow empty clauses, and hence empty modes.
* We treat an empty mode as no change to perms. */
while (*s) { /* Process clauses. */
if (*s == ',') { /* We allow empty clauses. */
while (*s) { /* Process clauses. */
if (*s == ',') { /* We allow empty clauses. */
++s;
continue;
}
@ -77,7 +77,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
}
} while (*++p);
do { /* Process action list. */
do { /* Process action list. */
if ((*s != '+') && (*s != '-')) {
if (*s != '=') {
return 0;
@ -93,7 +93,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
op = *s++;
/* Check for permcopy. */
p = who_chars + 1; /* Skip 'a' entry. */
p = who_chars + 1; /* Skip 'a' entry. */
do {
if (*p == *s) {
int i = 0;
@ -128,7 +128,7 @@ int FAST_FUNC bb_parse_mode(const char *s, mode_t *current_mode)
}
} while (*++p);
GOT_ACTION:
if (permlist) { /* The permlist was nonempty. */
if (permlist) { /* The permlist was nonempty. */
mode_t tmp = wholist;
if (!wholist) {
mode_t u_mask = umask(0);

View File

@ -7,7 +7,7 @@
*/
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -18,8 +18,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
* 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
*
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software

View File

@ -29,12 +29,12 @@ static const struct speed_map speeds[] = {
{B2400, 2400},
{B4800, 4800},
{B9600, 9600},
#ifdef B19200
#ifdef B19200
{B19200, 19200},
#elif defined(EXTA)
{EXTA, 19200},
#endif
#ifdef B38400
#ifdef B38400
{B38400, 38400/256 + 0x8000U},
#elif defined(EXTB)
{EXTB, 38400/256 + 0x8000U},

View File

@ -22,7 +22,7 @@ static void check_selinux_update_passwd(const char *username)
char *seuser;
if (getuid() != (uid_t)0 || is_selinux_enabled() == 0)
return; /* No need to check */
return; /* No need to check */
if (getprevcon_raw(&context) < 0)
bb_perror_msg_and_die("getprevcon failed");

View File

@ -31,7 +31,7 @@ FILE* FAST_FUNC xfopen_stdin(const char *filename)
FILE *fp = fopen_or_warn_stdin(filename);
if (fp)
return fp;
xfunc_die(); /* We already output an error message. */
xfunc_die(); /* We already output an error message. */
}
int FAST_FUNC open_or_warn_stdin(const char *filename)
@ -52,5 +52,5 @@ int FAST_FUNC xopen_stdin(const char *filename)
int fd = open_or_warn_stdin(filename);
if (fd >= 0)
return fd;
xfunc_die(); /* We already output an error message. */
xfunc_die(); /* We already output an error message. */
}

View File

@ -41,7 +41,7 @@ unsigned type FAST_FUNC xstrtou(_range_sfx)(const char *numstr, int base,
if (errno || numstr == e)
goto inval; /* error / no digits / illegal trailing chars */
errno = old_errno; /* Ok. So restore errno. */
errno = old_errno; /* Ok. So restore errno. */
/* Do optional suffix parsing. Allow 'empty' suffix tables.
* Note that we also allow nul suffixes with associated multipliers,

View File

@ -24,7 +24,7 @@ xrealloc_getcwd_or_warn(char *cwd)
char *ret;
unsigned path_max;
path_max = 128; /* 128 + 64 should be enough for 99% of cases */
path_max = 128; /* 128 + 64 should be enough for 99% of cases */
while (1) {
path_max += PATH_INCR;

View File

@ -21,13 +21,13 @@
#include <assert.h>
#ifndef _PATH_SHADOW
#define _PATH_SHADOW "/etc/shadow"
#define _PATH_SHADOW "/etc/shadow"
#endif
#ifndef _PATH_PASSWD
#define _PATH_PASSWD "/etc/passwd"
#define _PATH_PASSWD "/etc/passwd"
#endif
#ifndef _PATH_GROUP
#define _PATH_GROUP "/etc/group"
#define _PATH_GROUP "/etc/group"
#endif
/**********************************************************************/

View File

@ -14,8 +14,8 @@ static const char chpasswd_longopts[] ALIGN1 =
;
#endif
#define OPT_ENC 1
#define OPT_MD5 2
#define OPT_ENC 1
#define OPT_MD5 2
int chpasswd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int chpasswd_main(int argc UNUSED_PARAM, char **argv)

View File

@ -104,7 +104,7 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv)
xmove_fd(fd, STDIN_FILENO);
puts(pw_encrypt(
argv[0] ? argv[0] : (
argv[0] ? argv[0] : (
/* Only mkpasswd, and only from tty, prompts.
* Otherwise it is a plain read. */
(isatty(STDIN_FILENO) && applet_name[0] == 'm')

View File

@ -387,7 +387,7 @@ static char *get_logname(char *logname, unsigned size_logname,
struct options *op, struct chardata *cp)
{
char *bp;
char c; /* input character, full eight bits */
char c; /* input character, full eight bits */
char ascval; /* low 7 bits of input character */
int bits; /* # of "1" bits per character */
int mask; /* mask with 1 bit up */
@ -580,7 +580,7 @@ int getty_main(int argc UNUSED_PARAM, char **argv)
chardata = init_chardata;
memset(&options, 0, sizeof(options));
options.login = _PATH_LOGIN; /* default login program */
options.login = _PATH_LOGIN; /* default login program */
options.tty = "tty1"; /* default tty line */
options.initstring = ""; /* modem init string */
#ifdef ISSUE

View File

@ -124,7 +124,7 @@ static void run_login_script(struct passwd *pw, char *full_tty)
xsetenv("LOGIN_UID", utoa(pw->pw_uid));
xsetenv("LOGIN_GID", utoa(pw->pw_gid));
xsetenv("LOGIN_SHELL", pw->pw_shell);
spawn_and_wait(t_argv); /* NOMMU-friendly */
spawn_and_wait(t_argv); /* NOMMU-friendly */
unsetenv("LOGIN_TTY");
unsetenv("LOGIN_USER");
unsetenv("LOGIN_UID");
@ -245,7 +245,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
/* Let's find out and memorize our tty */
if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO) || !isatty(STDERR_FILENO))
return EXIT_FAILURE; /* Must be a terminal */
return EXIT_FAILURE; /* Must be a terminal */
full_tty = xmalloc_ttyname(STDIN_FILENO);
if (!full_tty)
full_tty = xstrdup("UNKNOWN");

View File

@ -10,7 +10,7 @@
#include "libbb.h"
// default timeout: 45 sec
#define DEFAULT_CHAT_TIMEOUT 45*1000
#define DEFAULT_CHAT_TIMEOUT 45*1000
// max length of "abort string",
// i.e. device reply which causes termination
#define MAX_ABORT_LEN 50

View File

@ -35,7 +35,7 @@
# define CRONUPDATE "cron.update"
#endif
#ifndef MAXLINES
# define MAXLINES 256 /* max lines in non-root crontabs */
# define MAXLINES 256 /* max lines in non-root crontabs */
#endif
@ -170,7 +170,7 @@ static void ParseField(char *user, char *ary, int modvalue, int off,
/* Handle numeric digit or symbol or '*' */
if (*ptr == '*') {
n1 = 0; /* everything will be filled */
n1 = 0; /* everything will be filled */
n2 = modvalue - 1;
skip = 1;
++ptr;

View File

@ -75,7 +75,7 @@
/* Various defines taken from linux/devfs_fs.h */
#define DEVFSD_PROTOCOL_REVISION_KERNEL 5
#define DEVFSD_IOCTL_BASE 'd'
#define DEVFSD_IOCTL_BASE 'd'
/* These are the various ioctls */
#define DEVFSDIOC_GET_PROTO_REV _IOR(DEVFSD_IOCTL_BASE, 0, int)
#define DEVFSDIOC_SET_EVENT_MASK _IOW(DEVFSD_IOCTL_BASE, 2, int)

View File

@ -14,10 +14,10 @@
#include <mtd/mtd-user.h>
#include <linux/jffs2.h>
#define OPTION_J (1 << 0)
#define OPTION_Q (1 << 1)
#define IS_NAND (1 << 2)
#define BBTEST (1 << 3)
#define OPTION_J (1 << 0)
#define OPTION_Q (1 << 1)
#define IS_NAND (1 << 2)
#define BBTEST (1 << 3)
/* mtd/jffs2-user.h used to have this atrocity:
extern int target_endian;

View File

@ -1745,7 +1745,7 @@ static void process_dev(char *devname)
if (-1 == read(fd, buf, sizeof(buf)))
bb_perror_msg("read of 512 bytes failed");
}
#endif /* HDIO_DRIVE_CMD */
#endif /* HDIO_DRIVE_CMD */
if (getset_mult || get_identity) {
multcount = -1;
if (ioctl(fd, HDIO_GET_MULTCOUNT, &multcount)) {

View File

@ -46,14 +46,14 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
static const char _ut_lin[] ALIGN1 =
"~\0" "{\0" "|\0" /* "LOGIN\0" "date\0" */;
enum {
TYPE_RUN_LVL = RUN_LVL, /* 1 */
TYPE_BOOT_TIME = BOOT_TIME, /* 2 */
TYPE_RUN_LVL = RUN_LVL, /* 1 */
TYPE_BOOT_TIME = BOOT_TIME, /* 2 */
TYPE_SHUTDOWN_TIME = SHUTDOWN_TIME
};
enum {
_TILDE = EMPTY, /* 0 */
TYPE_NEW_TIME, /* NEW_TIME, 3 */
TYPE_OLD_TIME /* OLD_TIME, 4 */
_TILDE = EMPTY, /* 0 */
TYPE_NEW_TIME, /* NEW_TIME, 3 */
TYPE_OLD_TIME /* OLD_TIME, 4 */
};
if (argv[1]) {

View File

@ -21,7 +21,7 @@
* redirected input has been read from stdin
*/
#include <sched.h> /* sched_yield() */
#include <sched.h> /* sched_yield() */
#include "libbb.h"
#if ENABLE_FEATURE_LESS_REGEXP
@ -477,7 +477,7 @@ static void m_status_print(void)
{
int percentage;
if (less_gets_pos >= 0) /* don't touch statusline while input is done! */
if (less_gets_pos >= 0) /* don't touch statusline while input is done! */
return;
clear_line();
@ -503,7 +503,7 @@ static void status_print(void)
{
const char *p;
if (less_gets_pos >= 0) /* don't touch statusline while input is done! */
if (less_gets_pos >= 0) /* don't touch statusline while input is done! */
return;
/* Change the status if flags have been set */

View File

@ -121,7 +121,7 @@ int makedevs_main(int argc UNUSED_PARAM, char **argv)
if ((2 > sscanf(line, "%40s %c %o %40s %40s %u %u %u %u %u",
name, &type, &mode, user, group,
&major, &minor, &start, &increment, &count))
&major, &minor, &start, &increment, &count))
|| ((unsigned)(major | minor | start | count | increment) > 255)
) {
bb_error_msg("invalid line %d: '%s'", linenum, line);

View File

@ -108,7 +108,7 @@ int mt_main(int argc UNUSED_PARAM, char **argv)
if (argv[2])
op.mt_count = xatoi_positive(argv[2]);
else
op.mt_count = 1; /* One, not zero, right? */
op.mt_count = 1; /* One, not zero, right? */
switch (opcode_value[idx]) {
case MTWEOF:

View File

@ -53,12 +53,12 @@
#define IS_NANDDUMP (ENABLE_NANDDUMP && (!ENABLE_NANDWRITE || (applet_name[4] == 'd')))
#define IS_NANDWRITE (ENABLE_NANDWRITE && (!ENABLE_NANDDUMP || (applet_name[4] != 'd')))
#define OPT_p (1 << 0) /* nandwrite only */
#define OPT_o (1 << 0) /* nanddump only */
#define OPT_s (1 << 1)
#define OPT_b (1 << 2)
#define OPT_f (1 << 3)
#define OPT_l (1 << 4)
#define OPT_p (1 << 0) /* nandwrite only */
#define OPT_o (1 << 0) /* nanddump only */
#define OPT_s (1 << 1)
#define OPT_b (1 << 2)
#define OPT_f (1 << 3)
#define OPT_l (1 << 4)
/* helper for writing out 0xff for bad blocks pad */
static void dump_bad(struct mtd_info_user *meminfo, unsigned len, int oob)

View File

@ -1,11 +1,11 @@
/* vi: set sw=4 ts=4: */
/*
* runlevel Prints out the previous and the current runlevel.
* Prints out the previous and the current runlevel.
*
* Version: @(#)runlevel 1.20 16-Apr-1997 MvS
* Version: @(#)runlevel 1.20 16-Apr-1997 MvS
*
* This file is part of the sysvinit suite,
* Copyright 1991-1997 Miquel van Smoorenburg.
* This file is part of the sysvinit suite,
* Copyright 1991-1997 Miquel van Smoorenburg.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*

View File

@ -9,10 +9,10 @@
#include "libbb.h"
#define WHOLE_FILE 1
#define PRINT_NAME 2
#define PRINT_OFFSET 4
#define SIZE 8
#define WHOLE_FILE 1
#define PRINT_NAME 2
#define PRINT_OFFSET 4
#define SIZE 8
int strings_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int strings_main(int argc UNUSED_PARAM, char **argv)

View File

@ -21,7 +21,7 @@ static void watchdog_shutdown(int sig UNUSED_PARAM)
{
static const char V = 'V';
write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */
write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */
if (ENABLE_FEATURE_CLEAN_UP)
close(3);
exit(EXIT_SUCCESS);

View File

@ -184,7 +184,7 @@ int brctl_main(int argc UNUSED_PARAM, char **argv)
tabs = 1;
printf("\t\t%s\n", ifname);
}
if (!tabs) /* bridge has no interfaces */
if (!tabs) /* bridge has no interfaces */
bb_putchar('\n');
}
goto done;

View File

@ -189,12 +189,12 @@ int ether_wake_main(int argc UNUSED_PARAM, char **argv)
unsigned flags;
unsigned char wol_passwd[6];
int wol_passwd_sz = 0;
int s; /* Raw socket */
int s; /* Raw socket */
int pktsize;
unsigned char outpack[1000];
struct ether_addr eaddr;
struct whereto_t whereto; /* who to wake up */
struct whereto_t whereto; /* who to wake up */
/* handle misc user options */
opt_complementary = "=1";

View File

@ -644,7 +644,7 @@ static const struct address_family_t addr_inet = {
methods
};
#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
#endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */
/* Returns pointer to the next word, or NULL.
* In 1st case, advances *buf to the word after this one.

View File

@ -21,7 +21,7 @@
#endif
/* taken from linux/sockios.h */
#define SIOCSIFNAME 0x8923 /* set interface name */
#define SIOCSIFNAME 0x8923 /* set interface name */
/* Exits on error */
static int get_ctl_fd(void)

View File

@ -297,11 +297,11 @@ void BUG_ping_globals_too_big(void);
} while (0)
#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */
#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */
#define SET(bit) (A(bit) |= B(bit))
#define CLR(bit) (A(bit) &= (~B(bit)))
#define TST(bit) (A(bit) & B(bit))
#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */
#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */
#define SET(bit) (A(bit) |= B(bit))
#define CLR(bit) (A(bit) &= (~B(bit)))
#define TST(bit) (A(bit) & B(bit))
/**************************************************************************/

View File

@ -1,10 +1,10 @@
/* vi: set sw=4 ts=4: */
/*
* tc.c "tc" utility frontend.
* "tc" utility frontend.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
* Bernhard Reutner-Fischer adjusted for busybox
*/

View File

@ -447,7 +447,7 @@ static int tftp_protocol(
/* NB: send_len value is preserved in code below
* for potential resend */
retries = TFTP_NUM_RETRIES; /* re-initialize */
retries = TFTP_NUM_RETRIES; /* re-initialize */
waittime_ms = TFTP_TIMEOUT_MS;
send_again:

View File

@ -413,7 +413,7 @@ int udhcpd_main(int argc UNUSED_PARAM, char **argv)
case SIGTERM:
bb_info_msg("Received SIGTERM");
goto ret0;
case 0: /* no signal: read a packet */
case 0: /* no signal: read a packet */
break;
default: /* signal or error (probably EINTR): back to select */
continue;

View File

@ -18,9 +18,9 @@ int dumpleases_main(int argc UNUSED_PARAM, char **argv)
struct in_addr addr;
enum {
OPT_a = 0x1, // -a
OPT_r = 0x2, // -r
OPT_f = 0x4, // -f
OPT_a = 0x1, // -a
OPT_r = 0x2, // -r
OPT_f = 0x4, // -f
};
#if ENABLE_LONG_OPTS
static const char dumpleases_longopts[] ALIGN1 =

View File

@ -39,7 +39,7 @@
/* Frequency of the ACPI timer */
#define FREQ_ACPI 3579.545
#define FREQ_ACPI_1000 3579545
#define FREQ_ACPI_1000 3579545
/* Max filename length of entry in /sys/devices subsystem */
#define BIG_SYSNAME_LEN 16
@ -115,8 +115,8 @@ static int write_str_to_file(const char *fname, const char *str)
}
/* Make it more readable */
#define start_timer() write_str_to_file("/proc/timer_stats", "1\n")
#define stop_timer() write_str_to_file("/proc/timer_stats", "0\n")
#define start_timer() write_str_to_file("/proc/timer_stats", "1\n")
#define stop_timer() write_str_to_file("/proc/timer_stats", "0\n")
static NOINLINE void clear_lines(void)
{
@ -362,7 +362,7 @@ static void process_irq_counts(void)
}
/* 0: 143646045 153901007 IO-APIC-edge timer
* NMI: 1 2 Non-maskable interrupts
* ^
* ^
*/
if (nr < 20000) {
/* Skip to the interrupt name, e.g. 'timer' */
@ -539,9 +539,9 @@ static void cpuid(unsigned int *eax, unsigned int *ebx, unsigned int *ecx,
}
#endif
#ifdef __i386__
static NOINLINE void print_intel_cstates(void)
{
#ifdef __i386__
int bios_table[8] = { 0 };
int nbios = 0;
DIR *cpudir;
@ -628,13 +628,15 @@ static NOINLINE void print_intel_cstates(void)
/* Print BIOS C-States */
printf("Your BIOS reports the following C-states: ");
for (i = 0; i < 8; i++)
for (i = 0; i < ARRAY_SIZE(bios_table); i++)
if (bios_table[i])
printf("C%u ", i);
bb_putchar('\n');
#endif
}
#else
# define print_intel_cstates(void) ((void)0)
#endif
static void show_timerstats(void)
{
@ -817,7 +819,7 @@ int powertop_main(int UNUSED_PARAM argc, char UNUSED_PARAM **argv)
sprintf(cstate_lines[0], "Cn\t\t Avg residency\n");
percentage = newticks * 100.0 / (G.total_cpus * DEFAULT_SLEEP * FREQ_ACPI_1000);
sprintf(cstate_lines[1], "C0 (cpu running) (%4.1f%%)\n", percentage);
sprintf(cstate_lines[1], "C0 (cpu running) (%4.1f%%)\n", percentage);
/* Compute values for individual C-states */
for (i = 0; i < MAX_CSTATE_COUNT; i++) {

View File

@ -32,7 +32,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv)
static const char Xetpriority_msg[] ALIGN1 = "%cetpriority";
int retval = EXIT_SUCCESS;
int which = PRIO_PROCESS; /* Default 'which' value. */
int which = PRIO_PROCESS; /* Default 'which' value. */
int use_relative = 0;
int adjustment, new_priority;
unsigned who;
@ -57,7 +57,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv)
arg += 2;
}
if (!arg) { /* No args? Then show usage. */
if (!arg) { /* No args? Then show usage. */
bb_show_usage();
}
@ -100,7 +100,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv)
if (use_relative) {
int old_priority;
errno = 0; /* Needed for getpriority error detection. */
errno = 0; /* Needed for getpriority error detection. */
old_priority = getpriority(which, who);
if (errno) {
bb_perror_msg(Xetpriority_msg, 'g');

View File

@ -122,10 +122,10 @@ static NOINLINE void edir(const char *directory_name)
if ((errno == EISDIR) && directory_name) {
if (option_mask32 & OPT_v)
bb_perror_msg("warning: %s/%s is a directory",
directory_name, d->d_name);
directory_name, d->d_name);
continue;
} else
bb_perror_msg_and_die("open %s/%s",
}
bb_perror_msg_and_die("open %s/%s",
directory_name, d->d_name);
}
size = full_read(fd, buf, sizeof(buf)-1);

View File

@ -1114,7 +1114,8 @@ int svlogd_main(int argc, char **argv)
/* Search for '\n' (in fact, np already holds the result) */
linelen = stdin_cnt;
if (np) {
print_to_nl: /* NB: starting from here lineptr may point
print_to_nl:
/* NB: starting from here lineptr may point
* farther out into line[] */
linelen = np - lineptr + 1;
}

View File

@ -7623,7 +7623,7 @@ hashcd(void)
for (cmdp = *pp; cmdp; cmdp = cmdp->next) {
if (cmdp->cmdtype == CMDNORMAL
|| (cmdp->cmdtype == CMDBUILTIN
&& !IS_BUILTIN_REGULAR(cmdp->param.cmd)
&& !IS_BUILTIN_REGULAR(cmdp->param.cmd)
&& builtinloc > 0)
) {
cmdp->rehash = 1;
@ -12325,7 +12325,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
}
if ((act & DO_NOFUNC)
|| !prefix(pathopt, "func")
) { /* ignore unimplemented options */
) { /* ignore unimplemented options */
continue;
}
}

View File

@ -2765,7 +2765,7 @@ static const struct reserved_combo* match_reserved_word(o_string *word)
};
const struct reserved_combo *r;
for (r = reserved_list; r < reserved_list + ARRAY_SIZE(reserved_list); r++) {
for (r = reserved_list; r < reserved_list + ARRAY_SIZE(reserved_list); r++) {
if (strcmp(word->data, r->literal) == 0)
return r;
}
@ -4660,7 +4660,7 @@ static NOINLINE const char *expand_one_var(char **to_be_freed_pp, char *arg, cha
char *exp_exp_word;
char *loc;
unsigned scan_flags = pick_scan(exp_op, *exp_word);
if (exp_op == *exp_word) /* ## or %% */
if (exp_op == *exp_word) /* ## or %% */
exp_word++;
exp_exp_word = encode_then_expand_string(exp_word, /*process_bkslash:*/ 1, /*unbackslash:*/ 1);
if (exp_exp_word)

View File

@ -121,7 +121,7 @@ int logger_main(int argc UNUSED_PARAM, char **argv)
/*-
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* This is the original license statement for the decode and pencode functions.
*
@ -134,8 +134,8 @@ int logger_main(int argc UNUSED_PARAM, char **argv)
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
* 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
* ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
*
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software

View File

@ -52,7 +52,7 @@ struct globals {
int n_evt;
} FIX_ALIASING;
#define G (*ptr_to_globals)
#define act_tab (G.act_tab)
#define act_tab (G.act_tab)
#define n_act (G.n_act )
#define evt_tab (G.evt_tab)
#define n_evt (G.n_evt )

View File

@ -36,7 +36,7 @@ struct format_descr {
unsigned int device,head,track;
};
#define FDFMTBEG _IO(2,0x47)
#define FDFMTTRK _IOW(2,0x48, struct format_descr)
#define FDFMTTRK _IOW(2,0x48, struct format_descr)
#define FDFMTEND _IO(2,0x49)
#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
#define FD_FILL_BYTE 0xF6 /* format fill byte. */

View File

@ -7,7 +7,7 @@
#define GPT_MAGIC 0x5452415020494645ULL
enum {
LEGACY_GPT_TYPE = 0xee,
LEGACY_GPT_TYPE = 0xee,
GPT_MAX_PARTS = 256,
GPT_MAX_PART_ENTRY_LEN = 4096,
GUID_LEN = 16,

View File

@ -654,7 +654,7 @@ sun_list_table(int xtra)
uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * g_heads * g_sectors;
uint32_t len = SUN_SSWAP32(sunlabel->partitions[i].num_sectors);
printf("%s %c%c %9lu %9lu %9lu%c %2x %s\n",
partname(disk_device, i+1, w), /* device */
partname(disk_device, i+1, w), /* device */
(sunlabel->infos[i].flags & 0x01) ? 'u' : ' ', /* flags */
(sunlabel->infos[i].flags & 0x10) ? 'r' : ' ',
(long) scround(start), /* start */

View File

@ -43,7 +43,6 @@ typedef enum type_id {
static int remove_ids(type_id type, int argc, char **argv)
{
unsigned long id;
int ret = 0; /* silence gcc */
int nb_errors = 0;
union semun arg;
@ -55,6 +54,7 @@ static int remove_ids(type_id type, int argc, char **argv)
bb_error_msg("invalid id: %s", argv[0]);
nb_errors++;
} else {
int ret = 0;
if (type == SEM)
ret = semctl(id, 0, IPC_RMID, arg);
else if (type == MSG)
@ -92,14 +92,13 @@ int ipcrm_main(int argc, char **argv)
type_id what = 0; /* silence gcc */
char w;
w=argv[1][0];
w = argv[1][0];
if ( ((w == 'm' && argv[1][1] == 's' && argv[1][2] == 'g')
|| (argv[1][0] == 's'
&& ((w=argv[1][1]) == 'h' || w == 'e')
&& ((w = argv[1][1]) == 'h' || w == 'e')
&& argv[1][2] == 'm')
) && argv[1][3] == '\0'
) {
if (argc < 3)
bb_show_usage();

View File

@ -11,8 +11,8 @@
#include <linux/fs.h>
#include <linux/ext2_fs.h>
#define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0
#define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1
#define ENABLE_FEATURE_MKFS_EXT2_RESERVED_GDT 0
#define ENABLE_FEATURE_MKFS_EXT2_DIR_INDEX 1
// from e2fsprogs
#define s_reserved_gdt_blocks s_padding1

View File

@ -28,7 +28,7 @@
#define ATTR_VOLUME 8
#define NUM_FATS 2
#define NUM_FATS 2
/* FAT32 filesystem looks like this:
* sector -nn...-1: "hidden" sectors, all sectors before this partition

View File

@ -97,7 +97,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv)
*/
to_write = sizeof(int);
if (!optMult)
to_write = 1; /* sth different from sizeof(int) */
to_write = 1; /* sth different from sizeof(int) */
fd = xopen(defaultpro, O_WRONLY);
xwrite(fd, &multiplier, to_write);
@ -179,7 +179,7 @@ int readprofile_main(int argc UNUSED_PARAM, char **argv)
if (*mode != 'T' && *mode != 't'
&& *mode != 'W' && *mode != 'w'
) {
break; /* only text is profiled */
break; /* only text is profiled */
}
if (indx >= len / sizeof(*buf))

View File

@ -50,7 +50,7 @@ static NOINLINE bool may_wakeup(const char *rtcname)
static NOINLINE void setup_alarm(int fd, time_t *wakeup, time_t rtc_time)
{
struct tm *ptm;
struct linux_rtc_wkalrm wake;
struct linux_rtc_wkalrm wake;
/* The wakeup time is in POSIX time (more or less UTC).
* Ideally RTCs use that same time; but PCs can't do that

View File

@ -6,7 +6,7 @@
*
* Based on code from util-linux v 2.12r
* Copyright (c) 1980
* The Regents of the University of California. All rights reserved.
* The Regents of the University of California. All rights reserved.
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/