whitespace cleanup. no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2013-01-14 15:57:44 +01:00
parent b8173b603f
commit 60cb48ca50
59 changed files with 233 additions and 219 deletions

View File

@ -253,24 +253,24 @@ static NOINLINE int cpio_o(void)
} }
bytes += printf("070701" bytes += printf("070701"
"%08X%08X%08X%08X%08X%08X%08X" "%08X%08X%08X%08X%08X%08X%08X"
"%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */ "%08X%08X%08X%08X" /* GNU cpio uses uppercase hex */
/* strlen+1: */ "%08X" /* strlen+1: */ "%08X"
/* chksum: */ "00000000" /* (only for "070702" files) */ /* chksum: */ "00000000" /* (only for "070702" files) */
/* name,NUL: */ "%s%c", /* name,NUL: */ "%s%c",
(unsigned)(uint32_t) st.st_ino, (unsigned)(uint32_t) st.st_ino,
(unsigned)(uint32_t) st.st_mode, (unsigned)(uint32_t) st.st_mode,
(unsigned)(uint32_t) st.st_uid, (unsigned)(uint32_t) st.st_uid,
(unsigned)(uint32_t) st.st_gid, (unsigned)(uint32_t) st.st_gid,
(unsigned)(uint32_t) st.st_nlink, (unsigned)(uint32_t) st.st_nlink,
(unsigned)(uint32_t) st.st_mtime, (unsigned)(uint32_t) st.st_mtime,
(unsigned)(uint32_t) st.st_size, (unsigned)(uint32_t) st.st_size,
(unsigned)(uint32_t) major(st.st_dev), (unsigned)(uint32_t) major(st.st_dev),
(unsigned)(uint32_t) minor(st.st_dev), (unsigned)(uint32_t) minor(st.st_dev),
(unsigned)(uint32_t) major(st.st_rdev), (unsigned)(uint32_t) major(st.st_rdev),
(unsigned)(uint32_t) minor(st.st_rdev), (unsigned)(uint32_t) minor(st.st_rdev),
(unsigned)(strlen(name) + 1), (unsigned)(strlen(name) + 1),
name, '\0'); name, '\0');
bytes = cpio_pad4(bytes); bytes = cpio_pad4(bytes);
if (st.st_size) { if (st.st_size) {

View File

@ -293,8 +293,8 @@ static unsigned fill_bitbuffer(STATE_PARAM unsigned bitbuffer, unsigned *current
* m: maximum lookup bits, returns actual * m: maximum lookup bits, returns actual
*/ */
static int huft_build(const unsigned *b, const unsigned n, static int huft_build(const unsigned *b, const unsigned n,
const unsigned s, const unsigned short *d, const unsigned s, const unsigned short *d,
const unsigned char *e, huft_t **t, unsigned *m) const unsigned char *e, huft_t **t, unsigned *m)
{ {
unsigned a; /* counter for codes of length k */ unsigned a; /* counter for codes of length k */
unsigned c[BMAX + 1]; /* bit length count table */ unsigned c[BMAX + 1]; /* bit length count table */

View File

@ -235,8 +235,8 @@ unpack_Z_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
p = &inbuf[posbits >> 3]; p = &inbuf[posbits >> 3];
bb_error_msg bb_error_msg
("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)", ("insize:%d posbits:%d inbuf:%02X %02X %02X %02X %02X (%d)",
insize, posbits, p[-1], p[0], p[1], p[2], p[3], insize, posbits, p[-1], p[0], p[1], p[2], p[3],
(posbits & 07)); (posbits & 07));
*/ */
bb_error_msg("corrupted data"); bb_error_msg("corrupted data");
goto err; goto err;

View File

@ -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, 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; int lazy_match_min_gain = 0;
@ -673,7 +673,7 @@ static int min_gain(unsigned ahead, unsigned lit1,
#if defined(SWD_BEST_OFF) #if defined(SWD_BEST_OFF)
static void better_match(const lzo_swd_p swd, 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) if (*m_len <= M2_MIN_LEN)
return; return;
@ -914,8 +914,8 @@ int lzo1x_999_compress_level(const uint8_t *in, unsigned in_len,
compression_level -= 7; compression_level -= 7;
return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem, return lzo1x_999_compress_internal(in, in_len, out, out_len, wrkmem,
c[compression_level].good_length, c[compression_level].good_length,
c[compression_level].max_lazy, c[compression_level].max_lazy,
c[compression_level].max_chain, c[compression_level].max_chain,
c[compression_level].use_best_off); c[compression_level].use_best_off);
} }

View File

@ -15,7 +15,7 @@
The LZO library is distributed in the hope that it will be useful, The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of 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. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License

View File

@ -15,7 +15,7 @@
The LZO library is distributed in the hope that it will be useful, The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of 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. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License

View File

@ -14,7 +14,7 @@
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of 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. GNU General Public License for more details.
You should have received a copy of the GNU General Public License 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 nl;
unsigned long o_m1_a = 0, o_m1_b = 0, o_m2 = 0, o_m3_a = 0, o_m3_b = 0; 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; *out_len = 0;
@ -346,8 +346,8 @@ static NOINLINE int lzo1x_optimize(uint8_t *in, unsigned in_len,
return LZO_E_EOF_NOT_FOUND; return LZO_E_EOF_NOT_FOUND;
eof_found: eof_found:
// LZO_UNUSED(o_m1_a); LZO_UNUSED(o_m1_b); LZO_UNUSED(o_m2); // 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_m3_a); LZO_UNUSED(o_m3_b);
*out_len = pd(op, out); *out_len = pd(op, out);
return (ip == ip_end ? LZO_E_OK : 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));

View File

@ -181,10 +181,11 @@ int cal_main(int argc UNUSED_PARAM, char **argv)
sprintf(lineout, "%u", year); sprintf(lineout, "%u", year);
center(lineout, center(lineout,
(WEEK_LEN * 3 + HEAD_SEP * 2) (WEEK_LEN * 3 + HEAD_SEP * 2)
+ julian * (J_WEEK_LEN * 2 + HEAD_SEP + julian * (J_WEEK_LEN * 2 + HEAD_SEP
- (WEEK_LEN * 3 + HEAD_SEP * 2)), - (WEEK_LEN * 3 + HEAD_SEP * 2)),
0); 0
);
puts("\n"); /* two \n's */ puts("\n"); /* two \n's */
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
day_array(i + 1, year, days[i]); day_array(i + 1, year, days[i]);

View File

@ -59,7 +59,7 @@ int mknod_main(int argc, char **argv)
/* Autodetect what the system supports; these macros should /* Autodetect what the system supports; these macros should
* optimize out to two constants. */ * optimize out to two constants. */
dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)), 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)));
} }
} }

View File

@ -1021,12 +1021,12 @@ dump(off_t current_offset, off_t end_offset)
l_c_m = get_lcm(); l_c_m = get_lcm();
/* Make bytes_to_write the smallest multiple of l_c_m that /* 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); 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); memset(block[idx] + n_bytes_read, 0, bytes_to_write - n_bytes_read);
write_block(current_offset, bytes_to_write, write_block(current_offset, bytes_to_write,
block[idx ^ 1], block[idx]); block[idx ^ 1], block[idx]);
current_offset += n_bytes_read; current_offset += n_bytes_read;
} }

View File

@ -591,37 +591,43 @@ static bool do_stat(const char *filename, const char *format)
# else # else
if (option_mask32 & OPT_TERSE) { if (option_mask32 & OPT_TERSE) {
format = (option_mask32 & OPT_SELINUX ? 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 %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\n"
);
} else { } else {
if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) { if (S_ISBLK(statbuf.st_mode) || S_ISCHR(statbuf.st_mode)) {
format = (option_mask32 & OPT_SELINUX ? format = (option_mask32 & OPT_SELINUX ?
" File: %N\n" " File: %N\n"
" Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"
"Device: %Dh/%dd\tInode: %-10i Links: %-5h" "Device: %Dh/%dd\tInode: %-10i Links: %-5h"
" Device type: %t,%T\n" " Device type: %t,%T\n"
"Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n"
" S_Context: %C\n" " S_Context: %C\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n": "Access: %x\n" "Modify: %y\n" "Change: %z\n"
" File: %N\n" :
" Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" " File: %N\n"
"Device: %Dh/%dd\tInode: %-10i Links: %-5h" " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"
" Device type: %t,%T\n" "Device: %Dh/%dd\tInode: %-10i Links: %-5h"
"Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" " Device type: %t,%T\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n"); "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n"
);
} else { } else {
format = (option_mask32 & OPT_SELINUX ? format = (option_mask32 & OPT_SELINUX ?
" File: %N\n" " File: %N\n"
" Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"
"Device: %Dh/%dd\tInode: %-10i Links: %h\n" "Device: %Dh/%dd\tInode: %-10i Links: %h\n"
"Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n"
"S_Context: %C\n" "S_Context: %C\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n": "Access: %x\n" "Modify: %y\n" "Change: %z\n"
" File: %N\n" :
" Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" " File: %N\n"
"Device: %Dh/%dd\tInode: %-10i Links: %h\n" " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n"
"Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" "Device: %Dh/%dd\tInode: %-10i Links: %h\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n"); "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n"
"Access: %x\n" "Modify: %y\n" "Change: %z\n"
);
} }
} }
# endif # endif

View File

@ -1056,7 +1056,7 @@ static void do_display(const struct termios *mode, int all)
} }
#endif #endif
wrapf("%s = %s;", nth_string(control_name, i), 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 VEOF == VMIN
if ((mode->c_lflag & ICANON) == 0) if ((mode->c_lflag & ICANON) == 0)

View File

@ -610,7 +610,7 @@ static int test_eaccess(char *path, int mode)
return 0; return 0;
/* Root can execute any file that has any one of the execute /* 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)) if (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
return 0; return 0;
} }

View File

@ -155,7 +155,7 @@ typedef struct tsplitter_s {
/* simple token classes */ /* simple token classes */
/* Order and hex values are very important!!! See next_token() */ /* 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_SEQTERM (1 << 1) /* ) */
#define TC_REGEXP (1 << 2) /* /.../ */ #define TC_REGEXP (1 << 2) /* /.../ */
#define TC_OUTRDR (1 << 3) /* | > >> */ #define TC_OUTRDR (1 << 3) /* | > >> */

View File

@ -843,7 +843,7 @@ static void diffdir(char *p[2], const char *s_start)
* add_to_dirlist will remove it. */ * add_to_dirlist will remove it. */
list[i].len = strlen(p[i]); list[i].len = strlen(p[i]);
recursive_action(p[i], ACTION_RECURSE | ACTION_FOLLOWLINKS, 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. /* Sort dl alphabetically.
* GNU diff does this ignoring any number of trailing dots. * GNU diff does this ignoring any number of trailing dots.
* We don't, so for us dotted files almost always are * We don't, so for us dotted files almost always are

View File

@ -14,7 +14,7 @@
* add :help command * add :help command
* :map macros * :map macros
* if mark[] values were line numbers rather than pointers * 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() * More intelligence in refresh()
* ":r !cmd" and "!cmd" to filter text through an external command * ":r !cmd" and "!cmd" to filter text through an external command
* A true "undo" facility * A true "undo" facility

View File

@ -638,7 +638,7 @@ int grep_main(int argc UNUSED_PARAM, char **argv)
if (opts & OPT_C) { if (opts & OPT_C) {
/* -C unsets prev -A and -B, but following -A or -B /* -C unsets prev -A and -B, but following -A or -B
may override it */ * may override it */
if (!(opts & OPT_A)) /* not overridden */ if (!(opts & OPT_A)) /* not overridden */
lines_after = Copt; lines_after = Copt;
if (!(opts & OPT_B)) /* not overridden */ if (!(opts & OPT_B)) /* not overridden */

View File

@ -520,7 +520,7 @@ static pid_t run(const struct init_action *a)
/* Log the process name and args */ /* Log the process name and args */
message(L_LOG, "starting pid %d, tty '%s': '%s'", 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, /* Now run it. The new program will take over this PID,
* so nothing further in init.c should be run. */ * so nothing further in init.c should be run. */

View File

@ -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) { if (s_in->sin_family != AF_INET) {
#ifdef DEBUG #ifdef DEBUG
bb_error_msg("rresolve: unsupported address family %d!", bb_error_msg("rresolve: unsupported address family %d!",
s_in->sin_family); s_in->sin_family);
#endif #endif
errno = EAFNOSUPPORT; errno = EAFNOSUPPORT;
return NULL; return NULL;
@ -195,7 +195,7 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
if (sin6->sin6_family != AF_INET6) { if (sin6->sin6_family != AF_INET6) {
#ifdef DEBUG #ifdef DEBUG
bb_error_msg("rresolve: unsupported address family %d!", bb_error_msg("rresolve: unsupported address family %d!",
sin6->sin6_family); sin6->sin6_family);
#endif #endif
errno = EAFNOSUPPORT; errno = EAFNOSUPPORT;
return NULL; return NULL;

View File

@ -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. /* If this block device already set up right, re-use it.
(Yes this is racy, but associating two loop devices with the same * (Yes this is racy, but associating two loop devices with the same
file isn't pretty either. In general, mounting the same file twice * file isn't pretty either. In general, mounting the same file twice
without using losetup manually is problematic.) * without using losetup manually is problematic.)
*/ */
} else } else
if (strcmp(file, (char *)loopinfo.lo_file_name) != 0 if (strcmp(file, (char *)loopinfo.lo_file_name) != 0

View File

@ -180,7 +180,7 @@ static char *skip_fields(char *str, int count)
#if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP #if ENABLE_FEATURE_TOPMEM || ENABLE_PMAP
int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total, 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; FILE *file;
struct smaprec currec; struct smaprec currec;

View File

@ -10,7 +10,7 @@
#include <selinux/context.h> #include <selinux/context.h>
context_t FAST_FUNC set_security_context_component(security_context_t cur_context, 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); context_t con = context_new(cur_context);
if (!con) if (!con)

View File

@ -300,8 +300,8 @@ struct group *getgrgid(gid_t gid)
* to have been created as a reentrant version of the non-standard * to have been created as a reentrant version of the non-standard
* functions getspuid. Why getspuid was added, I do not know. */ * functions getspuid. Why getspuid was added, I do not know. */
int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf, int getspuid_r(uid_t uid, struct spwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen, char *__restrict buffer, size_t buflen,
struct spwd **__restrict result) struct spwd **__restrict result)
{ {
int rv; int rv;
struct passwd *pp; struct passwd *pp;
@ -403,8 +403,8 @@ void endpwent(void)
int getpwent_r(struct passwd *__restrict resultbuf, int getpwent_r(struct passwd *__restrict resultbuf,
char *__restrict buffer, size_t buflen, char *__restrict buffer, size_t buflen,
struct passwd **__restrict result) struct passwd **__restrict result)
{ {
int rv; int rv;
@ -451,8 +451,8 @@ void endgrent(void)
} }
int getgrent_r(struct group *__restrict resultbuf, int getgrent_r(struct group *__restrict resultbuf,
char *__restrict buffer, size_t buflen, char *__restrict buffer, size_t buflen,
struct group **__restrict result) struct group **__restrict result)
{ {
int rv; int rv;
@ -501,7 +501,7 @@ void endspent(void)
} }
int getspent_r(struct spwd *resultbuf, char *buffer, int getspent_r(struct spwd *resultbuf, char *buffer,
size_t buflen, struct spwd **result) size_t buflen, struct spwd **result)
{ {
int rv; int rv;

View File

@ -219,7 +219,7 @@ static void action_execute(const struct devfsd_notify_struct *, const struct con
const regmatch_t *, unsigned); const regmatch_t *, unsigned);
static void action_modload(const struct devfsd_notify_struct *info, const struct config_entry_struct *entry); 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 *, 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 action_compat(const struct devfsd_notify_struct *, unsigned);
static void free_config(void); static void free_config(void);
static void restore(char *spath, struct stat source_stat, int rootlen); 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 const char *get_variable(const char *, void *);
static int make_dir_tree(const char *); static int make_dir_tree(const char *);
static int expand_expression(char *, unsigned, const char *, const char *(*)(const char *, void *), void *, 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 void expand_regexp(char *, size_t, const char *, const char *, const regmatch_t *, unsigned);
static const char *expand_variable( char *, unsigned, unsigned *, const char *, static const char *expand_variable( char *, unsigned, unsigned *, const char *,
const char *(*)(const char *, void *), void *); const char *(*)(const char *, void *), void *);
static const char *get_variable_v2(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 *); static char *write_old_sd_name(char *, unsigned, unsigned, const char *);
/* busybox functions */ /* 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 /*This action will pass "/dev/$devname"(i.e. "/dev/" prefixed to
the device name) to the module loading facility. In addition, the device name) to the module loading facility. In addition,
the /etc/modules.devfs configuration file is used.*/ the /etc/modules.devfs configuration file is used.*/
if (ENABLE_DEVFSD_MODLOAD) if (ENABLE_DEVFSD_MODLOAD)
new->action.what = AC_MODLOAD; new->action.what = AC_MODLOAD;
break; break;
case 6: /* EXECUTE */ case 6: /* EXECUTE */
new->action.what = AC_EXECUTE; new->action.what = AC_EXECUTE;
num_args -= 3; num_args -= 3;
@ -750,7 +750,7 @@ static void action_permissions(const struct devfsd_notify_struct *info,
} /* End Function action_permissions */ } /* End Function action_permissions */
static void action_modload(const struct devfsd_notify_struct *info, 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. /* [SUMMARY] Load a module.
<info> The devfs change. <info> The devfs change.
<entry> The config file entry. <entry> The config file entry.
@ -771,8 +771,8 @@ static void action_modload(const struct devfsd_notify_struct *info,
} /* End Function action_modload */ } /* End Function action_modload */
static void action_execute(const struct devfsd_notify_struct *info, static void action_execute(const struct devfsd_notify_struct *info,
const struct config_entry_struct *entry, const struct config_entry_struct *entry,
const regmatch_t *regexpr, unsigned int numexpr) const regmatch_t *regexpr, unsigned int numexpr)
/* [SUMMARY] Execute a programme. /* [SUMMARY] Execute a programme.
<info> The devfs change. <info> The devfs change.
<entry> The config file entry. <entry> The config file entry.
@ -1641,10 +1641,10 @@ st_expr_expand_out:
/* Private functions follow */ /* Private functions follow */
static const char *expand_variable(char *buffer, unsigned int length, static const char *expand_variable(char *buffer, unsigned int length,
unsigned int *out_pos, const char *input, unsigned int *out_pos, const char *input,
const char *(*func)(const char *variable, const char *(*func)(const char *variable,
void *info), void *info),
void *info) void *info)
/* [SUMMARY] Expand a variable. /* [SUMMARY] Expand a variable.
<buffer> The buffer to write to. <buffer> The buffer to write to.
<length> The length of the output buffer. <length> The length of the output buffer.
@ -1786,8 +1786,8 @@ expand_variable_out:
static const char *get_variable_v2(const char *variable, static const char *get_variable_v2(const char *variable,
const char *(*func)(const char *variable, void *info), const char *(*func)(const char *variable, void *info),
void *info) void *info)
/* [SUMMARY] Get a variable from the environment or . /* [SUMMARY] Get a variable from the environment or .
<variable> The variable name. <variable> The variable name.
<func> A function which will be used to get the variable. If this returns <func> A function which will be used to get the variable. If this returns

View File

@ -1022,8 +1022,8 @@ static void identify(uint16_t *val)
} }
if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) { if ((like_std > 3) && (val[CMDS_SUPP_1] & 0x0008)) {
/* We print out elsewhere whether the APM feature is enabled or /* 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 * not. If it's not enabled, let's not repeat the info; just print
nothing here. */ * nothing here. */
printf("\tAdvancedPM level: "); printf("\tAdvancedPM level: ");
if ((val[ADV_PWR] & 0xFF00) == 0x4000) { if ((val[ADV_PWR] & 0xFF00) == 0x4000) {
uint8_t apm_level = val[ADV_PWR] & 0x00FF; uint8_t apm_level = val[ADV_PWR] & 0x00FF;

View File

@ -93,14 +93,14 @@ static void show_entry(struct utmp *ut, int state, time_t dur_secs)
} }
printf(HEADER_FORMAT, printf(HEADER_FORMAT,
ut->ut_user, ut->ut_user,
ut->ut_line, ut->ut_line,
show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN, show_wide ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN,
ut->ut_host, ut->ut_host,
login_time, login_time,
logout_str, logout_str,
duration_str); duration_str);
} }
static int get_ut_type(struct utmp *ut) static int get_ut_type(struct utmp *ut)

View File

@ -60,7 +60,7 @@ int rmmod_main(int argc UNUSED_PARAM, char **argv)
filename2modname(bname, modname); filename2modname(bname, modname);
if (bb_delete_module(modname, flags)) if (bb_delete_module(modname, flags))
bb_error_msg_and_die("can't unload '%s': %s", bb_error_msg_and_die("can't unload '%s': %s",
modname, moderror(errno)); modname, moderror(errno));
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -133,9 +133,9 @@ int brctl_main(int argc UNUSED_PARAM, char **argv)
enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif
IF_FEATURE_BRCTL_FANCY(, IF_FEATURE_BRCTL_FANCY(,
ARG_stp, ARG_stp,
ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage, ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage,
ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio
) )
IF_FEATURE_BRCTL_SHOW(, ARG_show) 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"); bb_error_msg_and_die(bb_msg_invalid_arg, *argv, "port");
memset(ifidx, 0, sizeof ifidx); memset(ifidx, 0, sizeof ifidx);
arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx, arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long)ifidx,
MAX_PORTS); MAX_PORTS);
xioctl(fd, SIOCDEVPRIVATE, &ifr); xioctl(fd, SIOCDEVPRIVATE, &ifr);
for (i = 0; i < MAX_PORTS; i++) { for (i = 0; i < MAX_PORTS; i++) {
if (ifidx[i] == port) { if (ifidx[i] == port) {

View File

@ -49,9 +49,9 @@
* Copyright 1999-2003 Donald Becker and Scyld Computing Corporation. * Copyright 1999-2003 Donald Becker and Scyld Computing Corporation.
* *
* The author may be reached as becker@scyld, or C/O * The author may be reached as becker@scyld, or C/O
* Scyld Computing Corporation * Scyld Computing Corporation
* 914 Bay Ridge Road, Suite 220 * 914 Bay Ridge Road, Suite 220
* Annapolis MD 21403 * Annapolis MD 21403
* *
* Notes: * Notes:
* On some systems dropping root capability allows the process to be * 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 * Host name
* IP address string * IP address string
* MAC address string * MAC address string
*/ */
static void get_dest_addr(const char *hostid, struct ether_addr *eaddr) static void get_dest_addr(const char *hostid, struct ether_addr *eaddr)
{ {
struct ether_addr *eap; struct ether_addr *eap;

View File

@ -270,7 +270,7 @@ static int set_if_addr(char *master_ifname, char *slave_ifname)
if (res < 0) { if (res < 0) {
ifr.ifr_addr.sa_family = AF_INET; ifr.ifr_addr.sa_family = AF_INET;
memset(ifr.ifr_addr.sa_data, 0, 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); res = set_ifrname_and_do_ioctl(ifra[i].s_ioctl, &ifr, slave_ifname);

View File

@ -27,7 +27,7 @@
* {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> * {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
* - gettext instead of catgets for i18n * - gettext instead of catgets for i18n
* 10/1998 - Andi Kleen. Use interface list primitives. * 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) * (default AF was wrong)
*/ */

View File

@ -314,14 +314,16 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM,
if (rta_tb[IFA_BROADCAST]) { if (rta_tb[IFA_BROADCAST]) {
printf("brd %s ", printf("brd %s ",
rt_addr_n2a(ifa->ifa_family, rt_addr_n2a(ifa->ifa_family,
RTA_DATA(rta_tb[IFA_BROADCAST]), RTA_DATA(rta_tb[IFA_BROADCAST]),
abuf, sizeof(abuf))); abuf, sizeof(abuf))
);
} }
if (rta_tb[IFA_ANYCAST]) { if (rta_tb[IFA_ANYCAST]) {
printf("any %s ", printf("any %s ",
rt_addr_n2a(ifa->ifa_family, rt_addr_n2a(ifa->ifa_family,
RTA_DATA(rta_tb[IFA_ANYCAST]), RTA_DATA(rta_tb[IFA_ANYCAST]),
abuf, sizeof(abuf))); abuf, sizeof(abuf))
);
} }
printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1)); printf("scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1));
if (ifa->ifa_flags & IFA_F_SECONDARY) { if (ifa->ifa_flags & IFA_F_SECONDARY) {

View File

@ -73,15 +73,17 @@ static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM,
if (tb[RTA_SRC]) { if (tb[RTA_SRC]) {
if (r->rtm_src_len != host_len) { if (r->rtm_src_len != host_len) {
printf("%s/%u", rt_addr_n2a(r->rtm_family, printf("%s/%u", rt_addr_n2a(r->rtm_family,
RTA_DATA(tb[RTA_SRC]), RTA_DATA(tb[RTA_SRC]),
abuf, sizeof(abuf)), abuf, sizeof(abuf)),
r->rtm_src_len r->rtm_src_len
); );
} else { } else {
fputs(format_host(r->rtm_family, fputs(format_host(r->rtm_family,
RTA_PAYLOAD(tb[RTA_SRC]), RTA_PAYLOAD(tb[RTA_SRC]),
RTA_DATA(tb[RTA_SRC]), RTA_DATA(tb[RTA_SRC]),
abuf, sizeof(abuf)), stdout); abuf, sizeof(abuf)),
stdout
);
} }
} else if (r->rtm_src_len) { } else if (r->rtm_src_len) {
printf("0/%d", r->rtm_src_len); printf("0/%d", r->rtm_src_len);

View File

@ -438,7 +438,7 @@ static void print_tunnel(struct ip_tunnel_parm *p)
printf(" inherit"); printf(" inherit");
if (p->iph.tos & ~1) if (p->iph.tos & ~1)
printf("%c%s ", 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))) if (!(p->iph.frag_off & htons(IP_DF)))
printf(" nopmtudisc"); printf(" nopmtudisc");

View File

@ -187,7 +187,7 @@ static void prg_cache_add(long inode, char *name)
for (pnp = prg_hash + hi; (pn = *pnp) != NULL; pnp = &pn->next) { for (pnp = prg_hash + hi; (pn = *pnp) != NULL; pnp = &pn->next) {
if (pn->inode == inode) { if (pn->inode == inode) {
/* Some warning should be appropriate here /* 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; return;
} }
} }

View File

@ -507,8 +507,8 @@ void FAST_FUNC bb_displayroutes(int noresolve, int netstatfmt)
while (1) { while (1) {
int r; int r;
r = fscanf(fp, "%63s%lx%lx%X%d%d%d%lx%d%d%d\n", r = fscanf(fp, "%63s%lx%lx%X%d%d%d%lx%d%d%d\n",
devname, &d, &g, &flgs, &ref, &use, &metric, &m, devname, &d, &g, &flgs, &ref, &use, &metric, &m,
&mtu, &win, &ir); &mtu, &win, &ir);
if (r != 11) { if (r != 11) {
if ((r < 0) && feof(fp)) { /* EOF with no (nonspace) chars read. */ if ((r < 0) && feof(fp)) { /* EOF with no (nonspace) chars read. */
break; break;

View File

@ -391,7 +391,7 @@ static int print_class(const struct sockaddr_nl *who UNUSED_PARAM,
printf("root "); printf("root ");
else if (msg->tcm_parent) { else if (msg->tcm_parent) {
classid = print_tc_classid(filter_qdisc ? 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); printf("parent %s ", classid);
if (ENABLE_FEATURE_CLEAN_UP) if (ENABLE_FEATURE_CLEAN_UP)
free(classid); free(classid);
@ -526,7 +526,8 @@ int tc_main(int argc UNUSED_PARAM, char **argv)
duparg(*argv, "handle"); duparg(*argv, "handle");
/* reject LONG_MIN || LONG_MAX */ /* reject LONG_MIN || LONG_MAX */
/* TODO: for fw /* TODO: for fw
if ((slash = strchr(handle, '/')) != NULL) slash = strchr(handle, '/');
if (slash != NULL)
*slash = '\0'; *slash = '\0';
*/ */
msg.tcm_handle = get_u32(*argv, "handle"); msg.tcm_handle = get_u32(*argv, "handle");

View File

@ -290,9 +290,10 @@
#endif #endif
#define OPT_STRING "FIlnrdvxt:i:m:p:q:s:w:z:f:" \ #define OPT_STRING \
IF_FEATURE_TRACEROUTE_SOURCE_ROUTE("g:") \ "FIlnrdvxt:i:m:p:q:s:w:z:f:" \
"4" IF_TRACEROUTE6("6") IF_FEATURE_TRACEROUTE_SOURCE_ROUTE("g:") \
"4" IF_TRACEROUTE6("6")
enum { enum {
OPT_DONT_FRAGMNT = (1 << 0), /* F */ OPT_DONT_FRAGMNT = (1 << 0), /* F */
OPT_USE_ICMP = (1 << 1) * ENABLE_FEATURE_TRACEROUTE_USE_ICMP, /* I */ OPT_USE_ICMP = (1 << 1) * ENABLE_FEATURE_TRACEROUTE_USE_ICMP, /* I */

View File

@ -1723,7 +1723,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
#endif #endif
/* enter bound state */ /* enter bound state */
timeout = lease_seconds / 2; 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", bb_info_msg("Lease of %s obtained, lease time %u",
inet_ntoa(temp_addr), (unsigned)lease_seconds); inet_ntoa(temp_addr), (unsigned)lease_seconds);
requested_ip = packet.yiaddr; requested_ip = packet.yiaddr;

View File

@ -271,7 +271,7 @@ static int rdval_loadavg(const char* p, ullong *vec, ...)
} }
// Parses /proc/diskstats // 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 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 // 3 1 hda1 0 0 0 0 <- ignore if only 4 fields
// Linux 3.0 (maybe earlier) started printing full stats for hda1 too. // Linux 3.0 (maybe earlier) started printing full stats for hda1 too.

View File

@ -995,7 +995,7 @@ static unsigned handle_input(unsigned scan_mask, unsigned interval)
} }
# if ENABLE_FEATURE_SHOW_THREADS # if ENABLE_FEATURE_SHOW_THREADS
if (c == 'h' if (c == 'h'
IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK) IF_FEATURE_TOPMEM(&& scan_mask != TOPMEM_MASK)
) { ) {
scan_mask ^= PSSCAN_TASKS; scan_mask ^= PSSCAN_TASKS;
continue; continue;

View File

@ -172,7 +172,7 @@ static void update_status(struct svdir *s)
} }
close(fd); close(fd);
if (rename_or_warn("supervise/pid.new", 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; return;
pidchanged = 0; pidchanged = 0;
} }

View File

@ -601,12 +601,12 @@ static int buffer_pwrite(int n, char *s, unsigned len)
while (fchdir(ld->fddir) == -1) while (fchdir(ld->fddir) == -1)
pause2cannot("change directory, want remove old logfile", pause2cannot("change directory, want remove old logfile",
ld->name); ld->name);
oldest[0] = 'A'; oldest[0] = 'A';
oldest[1] = oldest[27] = '\0'; oldest[1] = oldest[27] = '\0';
while (!(d = opendir("."))) while (!(d = opendir(".")))
pause2cannot("open directory, want remove old logfile", pause2cannot("open directory, want remove old logfile",
ld->name); ld->name);
errno = 0; errno = 0;
while ((f = readdir(d))) while ((f = readdir(d)))
if ((f->d_name[0] == '@') && (strlen(f->d_name) == 27)) { if ((f->d_name[0] == '@') && (strlen(f->d_name) == 27)) {

View File

@ -92,7 +92,7 @@ static int FAST_FUNC change_filedir_context(
if (specified_context == NULL) { if (specified_context == NULL) {
context = set_security_context_component(file_context, context = set_security_context_component(file_context,
user, role, type, range); user, role, type, range);
if (!context) { if (!context) {
bb_error_msg("can't compute security context from %s", file_context); bb_error_msg("can't compute security context from %s", file_context);
goto skip; goto skip;
@ -121,15 +121,15 @@ static int FAST_FUNC change_filedir_context(
} }
if ((option_mask32 & OPT_VERBOSE) || ((option_mask32 & OPT_CHANHES) && !fail)) { if ((option_mask32 & OPT_VERBOSE) || ((option_mask32 & OPT_CHANHES) && !fail)) {
printf(!fail printf(!fail
? "context of %s changed to %s\n" ? "context of %s changed to %s\n"
: "can't change context of %s to %s\n", : "can't change context of %s to %s\n",
fname, context_string); fname, context_string);
} }
if (!fail) { if (!fail) {
rc = TRUE; rc = TRUE;
} else if ((option_mask32 & OPT_QUIET) == 0) { } else if ((option_mask32 & OPT_QUIET) == 0) {
bb_error_msg("can't change context of %s to %s", bb_error_msg("can't change context of %s to %s",
fname, context_string); fname, context_string);
} }
} else if (option_mask32 & OPT_VERBOSE) { } else if (option_mask32 & OPT_VERBOSE) {
printf("context of %s retained as %s\n", fname, context_string); 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 ENABLE_FEATURE_CHCON_LONG_OPTIONS
if (option_mask32 & OPT_REFERENCE) { if (option_mask32 & OPT_REFERENCE) {
/* FIXME: lgetfilecon() should be used when '-h' is specified. /* 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) if (getfilecon(reference_file, &specified_context) < 0)
bb_perror_msg_and_die("getfilecon('%s') failed", reference_file); bb_perror_msg_and_die("getfilecon('%s') failed", reference_file);
} else } else
@ -201,10 +201,10 @@ int chcon_main(int argc UNUSED_PARAM, char **argv)
fname[fname_len] = '\0'; fname[fname_len] = '\0';
if (recursive_action(fname, if (recursive_action(fname,
1<<option_mask32 & OPT_RECURSIVE, 1<<option_mask32 & OPT_RECURSIVE,
change_filedir_context, change_filedir_context,
change_filedir_context, change_filedir_context,
NULL, 0) != TRUE) NULL, 0) != TRUE)
errors = 1; errors = 1;
} }
return errors; return errors;

View File

@ -56,7 +56,7 @@
#include "libbb.h" #include "libbb.h"
static context_t runcon_compute_new_context(char *user, char *role, char *type, char *range, static context_t runcon_compute_new_context(char *user, char *role, char *type, char *range,
char *command, int compute_trans) char *command, int compute_trans)
{ {
context_t con; context_t con;
security_context_t cur_context; security_context_t cur_context;
@ -69,9 +69,9 @@ static context_t runcon_compute_new_context(char *user, char *role, char *type,
if (getfilecon(command, &file_context) < 0) if (getfilecon(command, &file_context) < 0)
bb_error_msg_and_die("can't retrieve attributes of '%s'", bb_error_msg_and_die("can't retrieve attributes of '%s'",
command); command);
if (security_compute_create(cur_context, file_context, if (security_compute_create(cur_context, file_context,
SECCLASS_PROCESS, &new_context)) SECCLASS_PROCESS, &new_context))
bb_error_msg_and_die("unable to compute a new context"); bb_error_msg_and_die("unable to compute a new context");
cur_context = new_context; cur_context = new_context;
} }
@ -147,11 +147,11 @@ int runcon_main(int argc UNUSED_PARAM, char **argv)
if (security_check_context(context_str(con))) if (security_check_context(context_str(con)))
bb_error_msg_and_die("'%s' is not a valid context", bb_error_msg_and_die("'%s' is not a valid context",
context_str(con)); context_str(con));
if (setexeccon(context_str(con))) if (setexeccon(context_str(con)))
bb_error_msg_and_die("can't set up security context '%s'", bb_error_msg_and_die("can't set up security context '%s'",
context_str(con)); context_str(con));
BB_EXECVP_or_die(argv); BB_EXECVP_or_die(argv);
} }

View File

@ -41,7 +41,7 @@ static void display_boolean(void)
if (pending < 0) if (pending < 0)
goto skip; goto skip;
printf(COL_FMT "%s", printf(COL_FMT "%s",
bools[i], active == 0 ? "off" : "on"); bools[i], active == 0 ? "off" : "on");
if (active != pending) if (active != pending)
printf(" (%sactivate pending)", pending == 0 ? "in" : ""); printf(" (%sactivate pending)", pending == 0 ? "in" : "");
bb_putchar('\n'); bb_putchar('\n');

View File

@ -498,10 +498,11 @@ static int process_one(char *name)
if (S_ISDIR(sb.st_mode) && recurse) { if (S_ISDIR(sb.st_mode) && recurse) {
if (recursive_action(name, if (recursive_action(name,
ACTION_RECURSE, ACTION_RECURSE,
apply_spec, apply_spec,
apply_spec, apply_spec,
NULL, 0) != TRUE) { NULL, 0) != TRUE
) {
bb_error_msg("error while labeling %s", name); bb_error_msg("error while labeling %s", name);
goto err; goto err;
} }
@ -584,7 +585,7 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
flags = getopt32(argv, "de:f:ilnpqr:svo:FW" flags = getopt32(argv, "de:f:ilnpqr:svo:FW"
IF_FEATURE_SETFILES_CHECK_OPTION("c:"), IF_FEATURE_SETFILES_CHECK_OPTION("c:"),
&exclude_dir, &input_filename, &rootpath, &out_filename, &exclude_dir, &input_filename, &rootpath, &out_filename,
IF_FEATURE_SETFILES_CHECK_OPTION(&policyfile,) IF_FEATURE_SETFILES_CHECK_OPTION(&policyfile,)
&verbose); &verbose);
} }
argv += optind; argv += optind;
@ -600,8 +601,8 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
fclose(policystream); fclose(policystream);
/* Only process the specified file_contexts file, not /* Only process the specified file_contexts file, not
any .homedirs or .local files, and do not perform * any .homedirs or .local files, and do not perform
context translations. */ * context translations. */
set_matchpathcon_flags(MATCHPATHCON_BASEONLY | set_matchpathcon_flags(MATCHPATHCON_BASEONLY |
MATCHPATHCON_NOTRANS | MATCHPATHCON_NOTRANS |
MATCHPATHCON_VALIDATE); MATCHPATHCON_VALIDATE);
@ -631,8 +632,8 @@ int setfiles_main(int argc UNUSED_PARAM, char **argv)
if (applet_name[0] == 's') { /* setfiles */ if (applet_name[0] == 's') { /* setfiles */
/* Use our own invalid context checking function so that /* Use our own invalid context checking function so that
we can support either checking against the active policy or * we can support either checking against the active policy or
checking against a binary policy file. */ * checking against a binary policy file. */
set_matchpathcon_canoncon(&canoncon); set_matchpathcon_canoncon(&canoncon);
if (!argv[0]) if (!argv[0])
bb_show_usage(); bb_show_usage();

View File

@ -3564,7 +3564,8 @@ set_curjob(struct job *jp, unsigned mode)
break; break;
case CUR_RUNNING: case CUR_RUNNING:
/* newly created job or backgrounded job, /* newly created job or backgrounded job,
put after all stopped jobs. */ * put after all stopped jobs.
*/
while (1) { while (1) {
jp1 = *jpp; jp1 = *jpp;
#if JOBS #if JOBS
@ -11640,8 +11641,9 @@ parsebackq: {
INT_ON; INT_ON;
if (oldstyle) { if (oldstyle) {
/* We must read until the closing backquote, giving special /* We must read until the closing backquote, giving special
treatment to some slashes, and then push the string and * treatment to some slashes, and then push the string and
reread it as input, interpreting it normally. */ * reread it as input, interpreting it normally.
*/
char *pout; char *pout;
size_t psavelen; size_t psavelen;
char *pstr; char *pstr;

View File

@ -4219,7 +4219,7 @@ static struct pipe *parse_stream(char **pstring,
/* (this makes bare "&" cmd a no-op. /* (this makes bare "&" cmd a no-op.
* bash says: "syntax error near unexpected token '&'") */ * bash says: "syntax error near unexpected token '&'") */
if (pi->num_cmds == 0 if (pi->num_cmds == 0
IF_HAS_KEYWORDS( && pi->res_word == RES_NONE) IF_HAS_KEYWORDS(&& pi->res_word == RES_NONE)
) { ) {
free_pipe_list(pi); free_pipe_list(pi);
pi = NULL; 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]); 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? */ /* Do we sit outside of any if's, loops or case's? */
if (!HAS_KEYWORDS 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); o_free(&dest);
#if !BB_MMU #if !BB_MMU

View File

@ -410,7 +410,7 @@ arith_apply(arith_state_t *math_state, operator op, var_or_num_t *numstack, var_
return "exponent less than 0"; return "exponent less than 0";
c = 1; c = 1;
while (--right_side_val >= 0) while (--right_side_val >= 0)
c *= rez; c *= rez;
rez = c; rez = c;
} }
else if (right_side_val == 0) else if (right_side_val == 0)

View File

@ -898,8 +898,7 @@ xbsd_initlabel(struct partition *p)
pp->p_fstype = BSD_FS_UNUSED; pp->p_fstype = BSD_FS_UNUSED;
#else #else
d->d_npartitions = 3; d->d_npartitions = 3;
pp = &d->d_partitions[2]; /* Partition C should be pp = &d->d_partitions[2]; /* Partition C should be the whole disk */
the whole disk */
pp->p_offset = 0; pp->p_offset = 0;
pp->p_size = d->d_secperunit; pp->p_size = d->d_secperunit;
pp->p_fstype = BSD_FS_UNUSED; pp->p_fstype = BSD_FS_UNUSED;
@ -935,7 +934,7 @@ xbsd_readlabel(struct partition *p)
fdisk_fatal(unable_to_read); fdisk_fatal(unable_to_read);
memmove(d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], 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) if (d->d_magic != BSD_DISKMAGIC || d->d_magic2 != BSD_DISKMAGIC)
return 0; return 0;

View File

@ -13,7 +13,7 @@
* 10.11.91 - updated, does checking, no repairs yet. * 10.11.91 - updated, does checking, no repairs yet.
* Sent out to the mailing-list for testing. * 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. * correction-code, and changed some functions.
* *
* 15.11.91 - More correction code. Hopefully it notices most * 15.11.91 - More correction code. Hopefully it notices most
@ -22,11 +22,10 @@
* 16.11.91 - More corrections (thanks to Mika Jalava). Most * 16.11.91 - More corrections (thanks to Mika Jalava). Most
* things seem to work now. Yeah, sure. * 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. * 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 * Sat Mar 6 18:59:42 1993, faith@cs.unc.edu: Output namelen with
* superblock information * superblock information
@ -35,31 +34,31 @@
* to that required by fsutil * to that required by fsutil
* *
* Mon Jan 3 11:06:52 1994 - Dr. Wettstein (greg%wind.uucp@plains.nodak.edu) * Mon Jan 3 11:06:52 1994 - Dr. Wettstein (greg%wind.uucp@plains.nodak.edu)
* Added support for file system valid flag. Also * Added support for file system valid flag. Also
* added program_version variable and output of * added program_version variable and output of
* program name and version number when program * program name and version number when program
* is executed. * is executed.
* *
* 30.10.94 - added support for v2 filesystem * 30.10.94 - added support for v2 filesystem
* (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de) * (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de)
* *
* 10.12.94 - added test to prevent checking of mounted fs adapted * 10.12.94 - added test to prevent checking of mounted fs adapted
* from Theodore Ts'o's (tytso@athena.mit.edu) e2fsck * from Theodore Ts'o's (tytso@athena.mit.edu) e2fsck
* program. (Daniel Quinlan, quinlan@yggdrasil.com) * program. (Daniel Quinlan, quinlan@yggdrasil.com)
* *
* 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such * 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 * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk
* (Russell King). He made them for ARM. It would seem * (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 >:-) * i386 and m64k must use assembly to get it fast >:-)
* This should make minix fsck system-independent. * This should make minix fsck system-independent.
* (janl@math.uio.no, Nicolai Langfeldt) * (janl@math.uio.no, Nicolai Langfeldt)
* *
* 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler * 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler
* warnings. Added mc68k bitops from * warnings. Added mc68k bitops from
* Joerg Dorchain <dorchain@mpi-sb.mpg.de>. * Joerg Dorchain <dorchain@mpi-sb.mpg.de>.
* *
* 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by * 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by
* Andreas Schwab. * Andreas Schwab.
@ -1131,7 +1130,7 @@ static void check_counts(void)
continue; continue;
} }
printf("Zone %d: %sin use, counted=%d\n", 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; continue;
} }
printf("Zone %d: %sin use, counted=%d\n", 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 #endif
@ -1253,7 +1252,7 @@ int fsck_minix_main(int argc UNUSED_PARAM, char **argv)
printf("Forcing filesystem check on %s\n", device_name); printf("Forcing filesystem check on %s\n", device_name);
else if (OPT_repair) else if (OPT_repair)
printf("Filesystem on %s is dirty, needs checking\n", printf("Filesystem on %s is dirty, needs checking\n",
device_name); device_name);
read_tables(); read_tables();
@ -1280,23 +1279,23 @@ int fsck_minix_main(int argc UNUSED_PARAM, char **argv)
if (!inode_in_use(i)) if (!inode_in_use(i))
free_cnt++; free_cnt++;
printf("\n%6u inodes used (%u%%)\n", (INODES - 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++) for (i = FIRSTZONE, free_cnt = 0; i < ZONES; i++)
if (!zone_in_use(i)) if (!zone_in_use(i))
free_cnt++; free_cnt++;
printf("%6u zones used (%u%%)\n\n" printf("%6u zones used (%u%%)\n\n"
"%6u regular files\n" "%6u regular files\n"
"%6u directories\n" "%6u directories\n"
"%6u character device files\n" "%6u character device files\n"
"%6u block device files\n" "%6u block device files\n"
"%6u links\n" "%6u links\n"
"%6u symbolic links\n" "%6u symbolic links\n"
"------\n" "------\n"
"%6u files\n", "%6u files\n",
(ZONES - free_cnt), 100 * (ZONES - free_cnt) / ZONES, (ZONES - free_cnt), 100 * (ZONES - free_cnt) / ZONES,
regular, directory, chardev, blockdev, regular, directory, chardev, blockdev,
links - 2 * directory + 1, symlinks, links - 2 * directory + 1, symlinks,
total - 2 * directory + 1); total - 2 * directory + 1);
} }
if (changed) { if (changed) {
write_tables(); write_tables();

View File

@ -372,7 +372,7 @@ int getopt_main(int argc, char **argv)
if (!argv[1]) { if (!argv[1]) {
if (compatible) { if (compatible) {
/* For some reason, the original getopt gave no error /* For some reason, the original getopt gave no error
when there were no arguments. */ * when there were no arguments. */
printf(" --\n"); printf(" --\n");
return 0; return 0;
} }

View File

@ -152,7 +152,7 @@ static NOINLINE void do_shm(void)
if ((shmctl(0, IPC_INFO, (struct shmid_ds *) (void *) &shminfo)) < 0) if ((shmctl(0, IPC_INFO, (struct shmid_ds *) (void *) &shminfo)) < 0)
return; return;
/* glibc 2.1.3 and all earlier libc's have ints as fields /* 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" printf("max number of segments = %lu\n"
"max seg size (kbytes) = %lu\n" "max seg size (kbytes) = %lu\n"
"max total shared memory (pages) = %lu\n" "max total shared memory (pages) = %lu\n"

View File

@ -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). // 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 ? 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); volume_id_set_uuid(id, sb->s_uuid, UUID_DCE);
if (sb->s_rev_level == 2) if (sb->s_rev_level == 2)

View File

@ -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); dbg("mft record size %i", mft_record_size);
buf = volume_id_get_buffer(id, off + mft_off + (MFT_RECORD_VOLUME * 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) if (buf == NULL)
goto found; goto found;
@ -165,7 +165,7 @@ int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/)
break; break;
dbg("found attribute type 0x%x, len %i, at offset %i", 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) { // if (attr_type == MFT_RECORD_ATTR_VOLUME_INFO) {
// struct volume_info *info; // struct volume_info *info;

View File

@ -109,7 +109,7 @@ nsr:
return -1; return -1;
dbg("vsd: %c%c%c%c%c", 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') if (vsd->id[0] == '\0')
return -1; return -1;

View File

@ -109,7 +109,7 @@ int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t of
extended = off + poff; extended = off + poff;
} else { } else {
dbg("found 0x%x data partition at 0x%llx, len 0x%llx", 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)) // if (is_raid(part[i].sys_ind))
// volume_id_set_usage_part(p, VOLUME_ID_RAID); // volume_id_set_usage_part(p, VOLUME_ID_RAID);

View File

@ -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); // volume_id_set_usage(id, VOLUME_ID_RAID);
// snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u", // 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"; // id->type = "silicon_medley_raid_member";
return 0; return 0;