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;
*/
#define SMALL_MEM
-#ifndef INBUFSIZ
+#ifndef INBUFSIZ
# ifdef SMALL_MEM
# define INBUFSIZ 0x2000 /* input buffer size */
# else
# endif
#endif
-#ifndef OUTBUFSIZ
+#ifndef OUTBUFSIZ
# ifdef SMALL_MEM
# define OUTBUFSIZ 8192 /* output buffer size */
# else
/* 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' */
* 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.
*
* 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
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,
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);
* 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) {
}
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";
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. */
if (scontext)
freecon(scontext);
# endif
-#endif /* FEATURE_STAT_FORMAT */
+#endif /* FEATURE_STAT_FORMAT */
return 1;
}
human_time(statbuf.st_mtime),
human_time(statbuf.st_ctime));
}
-#endif /* FEATURE_STAT_FORMAT */
+#endif /* FEATURE_STAT_FORMAT */
return 1;
}
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;
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;
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;)
}
free(cur_line);
- ++dups; /* testing for overflow seems excessive */
+ ++dups; /* testing for overflow seems excessive */
}
if (old_line) {
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)
#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"
*/
#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
/* 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.
*
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;
#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)))
goto is_root;
}
}
-#endif /* __GNU__ */
+#endif /* __GNU__ */
goto errout;
}
#ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */
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;
ret++;
break;
}
-#endif /* __GNU__ */
+#endif /* __GNU__ */
}
fclose(f);
return ret;
/*
* 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>
//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
};
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;
/* 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 */
*
* 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
#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;
* 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.
*
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 == '_') {
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"
/* 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;
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)
return xstrdup(name);
}
-#endif /* CONFIG_FEATURE_IPV6 */
+#endif /* CONFIG_FEATURE_IPV6 */
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;
time(&t);
uname(&uts);
- puts("\r"); /* start a new line */
+ puts("\r"); /* start a new line */
fp = fopen_for_read(issue_file);
if (!fp)
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 == '/') {
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
/* 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;
}
}
} while (*++p);
- do { /* Process action list. */
+ do { /* Process action list. */
if ((*s != '+') && (*s != '-')) {
if (*s != '=') {
return 0;
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;
}
} 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);
*/
/*-
* 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
* 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
{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},
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");
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)
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. */
}
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,
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;
#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
/**********************************************************************/
;
#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)
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')
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 */
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
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");
/* 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");
#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
# 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
/* 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;
/* 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)
#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;
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)) {
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]) {
* 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
{
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();
{
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 */
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);
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:
#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)
/* 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.
*
#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)
{
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);
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;
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";
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.
#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)
} 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))
/**************************************************************************/
/* 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
*/
/* 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:
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;
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 =
/* 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
}
/* 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)
{
}
/* 0: 143646045 153901007 IO-APIC-edge timer
* NMI: 1 2 Non-maskable interrupts
- * ^
+ * ^
*/
if (nr < 20000) {
/* Skip to the interrupt name, e.g. 'timer' */
}
#endif
+#ifdef __i386__
static NOINLINE void print_intel_cstates(void)
{
-#ifdef __i386__
int bios_table[8] = { 0 };
int nbios = 0;
DIR *cpudir;
/* 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)
{
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++) {
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;
arg += 2;
}
- if (!arg) { /* No args? Then show usage. */
+ if (!arg) { /* No args? Then show usage. */
bb_show_usage();
}
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');
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);
/* 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;
}
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;
}
if ((act & DO_NOFUNC)
|| !prefix(pathopt, "func")
- ) { /* ignore unimplemented options */
+ ) { /* ignore unimplemented options */
continue;
}
}
};
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;
}
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)
/*-
* 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.
*
* 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
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 )
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. */
#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,
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 */
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;
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)
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();
#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
#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
*/
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);
if (*mode != 'T' && *mode != 't'
&& *mode != 'W' && *mode != 'w'
) {
- break; /* only text is profiled */
+ break; /* only text is profiled */
}
if (indx >= len / sizeof(*buf))
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
*
* 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.
*/