aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/Config.in4
-rw-r--r--util-linux/fbset.c136
-rw-r--r--util-linux/fdformat.c8
-rw-r--r--util-linux/getopt.c456
-rw-r--r--util-linux/hwclock.c10
-rw-r--r--util-linux/ipcrm.c10
-rw-r--r--util-linux/ipcs.c44
-rw-r--r--util-linux/losetup.c16
-rw-r--r--util-linux/mdev.c32
-rw-r--r--util-linux/mount.c16
-rw-r--r--util-linux/nfsmount.c10
-rw-r--r--util-linux/pivot_root.c2
-rw-r--r--util-linux/rdate.c10
-rw-r--r--util-linux/readprofile.c4
-rw-r--r--util-linux/switch_root.c18
15 files changed, 388 insertions, 388 deletions
diff --git a/util-linux/Config.in b/util-linux/Config.in
index bf3e13b2a..27410bf10 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -214,7 +214,7 @@ config CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS
depends on CONFIG_HWCLOCK
help
Starting with FHS 2.3, the adjtime state file is supposed to exist
- at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish
+ at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish
to use the FHS behavior, answer Y here, otherwise answer N for the
classic /etc/adjtime path.
@@ -406,7 +406,7 @@ config CONFIG_FEATURE_MOUNT_LOOP
command will detect you are trying to mount a file instead of a block
device, and transparently associate the file with a loopback device.
The umount command will also free that loopback device.
-
+
You can still use the 'losetup' utility (to manually associate files
with loop devices) if you need to do something advanced, such as
specify an offset or cryptographic options to the loopback device.
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 83bf309a3..b1118311f 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -52,7 +52,7 @@ enum {
CMD_VSYNC = 7,
CMD_LACED = 8,
CMD_DOUBLE = 9,
-/* CMD_XCOMPAT = 10, */
+/* CMD_XCOMPAT = 10, */
CMD_ALL = 11,
CMD_INFO = 12,
CMD_CHANGE = 13,
@@ -207,70 +207,70 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
- if ((p = strstr(buf, "geometry "))) {
- p += 9;
-
- sscanf(p, "%d %d %d %d %d",
- &(base->xres), &(base->yres),
- &(base->xres_virtual), &(base->yres_virtual),
- &(base->bits_per_pixel));
- } else if ((p = strstr(buf, "timings "))) {
- p += 8;
-
- sscanf(p, "%d %d %d %d %d %d %d",
- &(base->pixclock),
- &(base->left_margin), &(base->right_margin),
- &(base->upper_margin), &(base->lower_margin),
- &(base->hsync_len), &(base->vsync_len));
- } else if ((p = strstr(buf, "laced "))) {
- p += 6;
-
- if (strstr(buf, "false")) {
- base->vmode &= ~FB_VMODE_INTERLACED;
- } else {
- base->vmode |= FB_VMODE_INTERLACED;
- }
- } else if ((p = strstr(buf, "double "))) {
- p += 7;
-
- if (strstr(buf, "false")) {
- base->vmode &= ~FB_VMODE_DOUBLE;
- } else {
- base->vmode |= FB_VMODE_DOUBLE;
- }
- } else if ((p = strstr(buf, "vsync "))) {
- p += 6;
-
- if (strstr(buf, "low")) {
- base->sync &= ~FB_SYNC_VERT_HIGH_ACT;
- } else {
- base->sync |= FB_SYNC_VERT_HIGH_ACT;
- }
- } else if ((p = strstr(buf, "hsync "))) {
- p += 6;
-
- if (strstr(buf, "low")) {
- base->sync &= ~FB_SYNC_HOR_HIGH_ACT;
- } else {
- base->sync |= FB_SYNC_HOR_HIGH_ACT;
- }
- } else if ((p = strstr(buf, "csync "))) {
- p += 6;
-
- if (strstr(buf, "low")) {
- base->sync &= ~FB_SYNC_COMP_HIGH_ACT;
- } else {
- base->sync |= FB_SYNC_COMP_HIGH_ACT;
- }
- } else if ((p = strstr(buf, "extsync "))) {
- p += 8;
-
- if (strstr(buf, "false")) {
- base->sync &= ~FB_SYNC_EXT;
- } else {
- base->sync |= FB_SYNC_EXT;
- }
- }
+ if ((p = strstr(buf, "geometry "))) {
+ p += 9;
+
+ sscanf(p, "%d %d %d %d %d",
+ &(base->xres), &(base->yres),
+ &(base->xres_virtual), &(base->yres_virtual),
+ &(base->bits_per_pixel));
+ } else if ((p = strstr(buf, "timings "))) {
+ p += 8;
+
+ sscanf(p, "%d %d %d %d %d %d %d",
+ &(base->pixclock),
+ &(base->left_margin), &(base->right_margin),
+ &(base->upper_margin), &(base->lower_margin),
+ &(base->hsync_len), &(base->vsync_len));
+ } else if ((p = strstr(buf, "laced "))) {
+ p += 6;
+
+ if (strstr(buf, "false")) {
+ base->vmode &= ~FB_VMODE_INTERLACED;
+ } else {
+ base->vmode |= FB_VMODE_INTERLACED;
+ }
+ } else if ((p = strstr(buf, "double "))) {
+ p += 7;
+
+ if (strstr(buf, "false")) {
+ base->vmode &= ~FB_VMODE_DOUBLE;
+ } else {
+ base->vmode |= FB_VMODE_DOUBLE;
+ }
+ } else if ((p = strstr(buf, "vsync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_VERT_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_VERT_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "hsync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_HOR_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_HOR_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "csync "))) {
+ p += 6;
+
+ if (strstr(buf, "low")) {
+ base->sync &= ~FB_SYNC_COMP_HIGH_ACT;
+ } else {
+ base->sync |= FB_SYNC_COMP_HIGH_ACT;
+ }
+ } else if ((p = strstr(buf, "extsync "))) {
+ p += 8;
+
+ if (strstr(buf, "false")) {
+ base->sync &= ~FB_SYNC_EXT;
+ } else {
+ base->sync |= FB_SYNC_EXT;
+ }
+ }
if (strstr(buf, "endmode"))
return 1;
@@ -374,9 +374,9 @@ extern int fbset_main(int argc, char **argv)
varset.hsync_len = strtoul(argv[6], 0, 0);
varset.vsync_len = strtoul(argv[7], 0, 0);
break;
- case CMD_CHANGE:
- g_options |= OPT_CHANGE;
- break;
+ case CMD_CHANGE:
+ g_options |= OPT_CHANGE;
+ break;
#ifdef CONFIG_FEATURE_FBSET_FANCY
case CMD_XRES:
varset.xres = strtoul(argv[1], 0, 0);
diff --git a/util-linux/fdformat.c b/util-linux/fdformat.c
index 768105159..e7dd943bb 100644
--- a/util-linux/fdformat.c
+++ b/util-linux/fdformat.c
@@ -134,7 +134,7 @@ int fdformat_main(int argc,char **argv)
if((read_bytes = safe_read(fd,data,n))!= n ) {
if(read_bytes < 0) {
bb_perror_msg("Read: ");
- }
+ }
bb_error_msg_and_die("Problem reading cylinder %d, expected %d, read %d", cyl, n, read_bytes);
}
/* Check backwards so we don't need a counter */
@@ -147,14 +147,14 @@ int fdformat_main(int argc,char **argv)
/* There is no point in freeing blocks at the end of a program, because
all of the program's space is given back to the system when the process
terminates.*/
-
+
if (ENABLE_FEATURE_CLEAN_UP) free(data);
-
+
print_and_flush("done\n", NULL);
}
if (ENABLE_FEATURE_CLEAN_UP) close(fd);
-
+
/* Don't bother closing. Exit does
* that, so we can save a few bytes */
return EXIT_SUCCESS;
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index fc3b9f97e..16dcbbca0 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -71,7 +71,7 @@ static int alternative; /* 0 is getopt_long, 1 is getopt_long_only */
/* Function prototypes */
static const char *normalize(const char *arg);
static int generate_output(char * argv[],int argc,const char *optstr,
- const struct option *longopts);
+ const struct option *longopts);
static void add_long_options(char *options);
static void add_longopt(const char *name,int has_arg);
static void set_shell(const char *new_shell);
@@ -88,57 +88,57 @@ static void set_shell(const char *new_shell);
*/
const char *normalize(const char *arg)
{
- static char *BUFFER=NULL;
- const char *argptr=arg;
- char *bufptr;
-
- free(BUFFER);
-
- if (!quote) { /* Just copy arg */
- BUFFER=bb_xstrdup(arg);
- return BUFFER;
- }
-
- /* Each character in arg may take up to four characters in the result:
- For a quote we need a closing quote, a backslash, a quote and an
- opening quote! We need also the global opening and closing quote,
- and one extra character for '\0'. */
- BUFFER=xmalloc(strlen(arg)*4+3);
-
- bufptr=BUFFER;
- *bufptr++='\'';
-
- while (*argptr) {
- if (*argptr == '\'') {
- /* Quote: replace it with: '\'' */
- *bufptr++='\'';
- *bufptr++='\\';
- *bufptr++='\'';
- *bufptr++='\'';
- } else if (shell==TCSH && *argptr=='!') {
- /* Exclamation mark: replace it with: \! */
- *bufptr++='\'';
- *bufptr++='\\';
- *bufptr++='!';
- *bufptr++='\'';
- } else if (shell==TCSH && *argptr=='\n') {
- /* Newline: replace it with: \n */
- *bufptr++='\\';
- *bufptr++='n';
- } else if (shell==TCSH && isspace(*argptr)) {
- /* Non-newline whitespace: replace it with \<ws> */
- *bufptr++='\'';
- *bufptr++='\\';
- *bufptr++=*argptr;
- *bufptr++='\'';
- } else
- /* Just copy */
- *bufptr++=*argptr;
- argptr++;
- }
- *bufptr++='\'';
- *bufptr++='\0';
- return BUFFER;
+ static char *BUFFER=NULL;
+ const char *argptr=arg;
+ char *bufptr;
+
+ free(BUFFER);
+
+ if (!quote) { /* Just copy arg */
+ BUFFER=bb_xstrdup(arg);
+ return BUFFER;
+ }
+
+ /* Each character in arg may take up to four characters in the result:
+ For a quote we need a closing quote, a backslash, a quote and an
+ opening quote! We need also the global opening and closing quote,
+ and one extra character for '\0'. */
+ BUFFER=xmalloc(strlen(arg)*4+3);
+
+ bufptr=BUFFER;
+ *bufptr++='\'';
+
+ while (*argptr) {
+ if (*argptr == '\'') {
+ /* Quote: replace it with: '\'' */
+ *bufptr++='\'';
+ *bufptr++='\\';
+ *bufptr++='\'';
+ *bufptr++='\'';
+ } else if (shell==TCSH && *argptr=='!') {
+ /* Exclamation mark: replace it with: \! */
+ *bufptr++='\'';
+ *bufptr++='\\';
+ *bufptr++='!';
+ *bufptr++='\'';
+ } else if (shell==TCSH && *argptr=='\n') {
+ /* Newline: replace it with: \n */
+ *bufptr++='\\';
+ *bufptr++='n';
+ } else if (shell==TCSH && isspace(*argptr)) {
+ /* Non-newline whitespace: replace it with \<ws> */
+ *bufptr++='\'';
+ *bufptr++='\\';
+ *bufptr++=*argptr;
+ *bufptr++='\'';
+ } else
+ /* Just copy */
+ *bufptr++=*argptr;
+ argptr++;
+ }
+ *bufptr++='\'';
+ *bufptr++='\0';
+ return BUFFER;
}
/*
@@ -149,47 +149,47 @@ const char *normalize(const char *arg)
* Other settings are found in global variables.
*/
int generate_output(char * argv[],int argc,const char *optstr,
- const struct option *longopts)
+ const struct option *longopts)
{
- int exit_code = 0; /* We assume everything will be OK */
- int opt;
- int longindex;
- const char *charptr;
-
- if (quiet_errors) /* No error reporting from getopt(3) */
- opterr=0;
- optind=0; /* Reset getopt(3) */
-
- while ((opt = (alternative?
- getopt_long_only(argc,argv,optstr,longopts,&longindex):
- getopt_long(argc,argv,optstr,longopts,&longindex)))
- != EOF)
- if (opt == '?' || opt == ':' )
- exit_code = 1;
- else if (!quiet_output) {
- if (opt == LONG_OPT) {
- printf(" --%s",longopts[longindex].name);
- if (longopts[longindex].has_arg)
- printf(" %s",
- normalize(optarg?optarg:""));
- } else if (opt == NON_OPT)
- printf(" %s",normalize(optarg));
- else {
- printf(" -%c",opt);
- charptr = strchr(optstr,opt);
- if (charptr != NULL && *++charptr == ':')
- printf(" %s",
- normalize(optarg?optarg:""));
- }
- }
-
- if (! quiet_output) {
- printf(" --");
- while (optind < argc)
- printf(" %s",normalize(argv[optind++]));
- printf("\n");
- }
- return exit_code;
+ int exit_code = 0; /* We assume everything will be OK */
+ int opt;
+ int longindex;
+ const char *charptr;
+
+ if (quiet_errors) /* No error reporting from getopt(3) */
+ opterr=0;
+ optind=0; /* Reset getopt(3) */
+
+ while ((opt = (alternative?
+ getopt_long_only(argc,argv,optstr,longopts,&longindex):
+ getopt_long(argc,argv,optstr,longopts,&longindex)))
+ != EOF)
+ if (opt == '?' || opt == ':' )
+ exit_code = 1;
+ else if (!quiet_output) {
+ if (opt == LONG_OPT) {
+ printf(" --%s",longopts[longindex].name);
+ if (longopts[longindex].has_arg)
+ printf(" %s",
+ normalize(optarg?optarg:""));
+ } else if (opt == NON_OPT)
+ printf(" %s",normalize(optarg));
+ else {
+ printf(" -%c",opt);
+ charptr = strchr(optstr,opt);
+ if (charptr != NULL && *++charptr == ':')
+ printf(" %s",
+ normalize(optarg?optarg:""));
+ }
+ }
+
+ if (! quiet_output) {
+ printf(" --");
+ while (optind < argc)
+ printf(" %s",normalize(argv[optind++]));
+ printf("\n");
+ }
+ return exit_code;
}
static struct option *long_options;
@@ -201,32 +201,32 @@ static const int LONG_OPTIONS_INCR = 10;
/* Register a long option. The contents of name is copied. */
void add_longopt(const char *name,int has_arg)
{
- if (!name) { /* init */
- free(long_options);
- long_options=NULL;
- long_options_length=0;
- long_options_nr=0;
- }
-
- if (long_options_nr == long_options_length) {
- long_options_length += LONG_OPTIONS_INCR;
- long_options=xrealloc(long_options,
- sizeof(struct option) *
- long_options_length);
- }
-
- long_options[long_options_nr].name=NULL;
- long_options[long_options_nr].has_arg=0;
- long_options[long_options_nr].flag=NULL;
- long_options[long_options_nr].val=0;
-
- if (long_options_nr) { /* Not for init! */
- long_options[long_options_nr-1].has_arg=has_arg;
- long_options[long_options_nr-1].flag=NULL;
- long_options[long_options_nr-1].val=LONG_OPT;
- long_options[long_options_nr-1].name=bb_xstrdup(name);
- }
- long_options_nr++;
+ if (!name) { /* init */
+ free(long_options);
+ long_options=NULL;
+ long_options_length=0;
+ long_options_nr=0;
+ }
+
+ if (long_options_nr == long_options_length) {
+ long_options_length += LONG_OPTIONS_INCR;
+ long_options=xrealloc(long_options,
+ sizeof(struct option) *
+ long_options_length);
+ }
+
+ long_options[long_options_nr].name=NULL;
+ long_options[long_options_nr].has_arg=0;
+ long_options[long_options_nr].flag=NULL;
+ long_options[long_options_nr].val=0;
+
+ if (long_options_nr) { /* Not for init! */
+ long_options[long_options_nr-1].has_arg=has_arg;
+ long_options[long_options_nr-1].flag=NULL;
+ long_options[long_options_nr-1].val=LONG_OPT;
+ long_options[long_options_nr-1].name=bb_xstrdup(name);
+ }
+ long_options_nr++;
}
@@ -237,43 +237,43 @@ void add_longopt(const char *name,int has_arg)
*/
void add_long_options(char *options)
{
- int arg_opt, tlen;
- char *tokptr=strtok(options,", \t\n");
- while (tokptr) {
- arg_opt=no_argument;
+ int arg_opt, tlen;
+ char *tokptr=strtok(options,", \t\n");
+ while (tokptr) {
+ arg_opt=no_argument;
tlen=strlen(tokptr);
- if (tlen > 0) {
- if (tokptr[tlen-1] == ':') {
- if (tlen > 1 && tokptr[tlen-2] == ':') {
- tokptr[tlen-2]='\0';
+ if (tlen > 0) {
+ if (tokptr[tlen-1] == ':') {
+ if (tlen > 1 && tokptr[tlen-2] == ':') {
+ tokptr[tlen-2]='\0';
tlen -= 2;
- arg_opt=optional_argument;
- } else {
- tokptr[tlen-1]='\0';
+ arg_opt=optional_argument;
+ } else {
+ tokptr[tlen-1]='\0';
tlen -= 1;
- arg_opt=required_argument;
- }
- if (tlen == 0)
- bb_error_msg("empty long option after -l or --long argument");
- }
- add_longopt(tokptr,arg_opt);
- }
- tokptr=strtok(NULL,", \t\n");
- }
+ arg_opt=required_argument;
+ }
+ if (tlen == 0)
+ bb_error_msg("empty long option after -l or --long argument");
+ }
+ add_longopt(tokptr,arg_opt);
+ }
+ tokptr=strtok(NULL,", \t\n");
+ }
}
void set_shell(const char *new_shell)
{
- if (!strcmp(new_shell,"bash"))
- shell=BASH;
- else if (!strcmp(new_shell,"tcsh"))
- shell=TCSH;
- else if (!strcmp(new_shell,"sh"))
- shell=BASH;
- else if (!strcmp(new_shell,"csh"))
- shell=TCSH;
- else
- bb_error_msg("unknown shell after -s or --shell argument");
+ if (!strcmp(new_shell,"bash"))
+ shell=BASH;
+ else if (!strcmp(new_shell,"tcsh"))
+ shell=TCSH;
+ else if (!strcmp(new_shell,"sh"))
+ shell=BASH;
+ else if (!strcmp(new_shell,"csh"))
+ shell=TCSH;
+ else
+ bb_error_msg("unknown shell after -s or --shell argument");
}
@@ -287,16 +287,16 @@ void set_shell(const char *new_shell)
static const struct option longopts[]=
{
- {"options",required_argument,NULL,'o'},
- {"longoptions",required_argument,NULL,'l'},
- {"quiet",no_argument,NULL,'q'},
- {"quiet-output",no_argument,NULL,'Q'},
- {"shell",required_argument,NULL,'s'},
- {"test",no_argument,NULL,'T'},
- {"unquoted",no_argument,NULL,'u'},
- {"alternative",no_argument,NULL,'a'},
- {"name",required_argument,NULL,'n'},
- {NULL,0,NULL,0}
+ {"options",required_argument,NULL,'o'},
+ {"longoptions",required_argument,NULL,'l'},
+ {"quiet",no_argument,NULL,'q'},
+ {"quiet-output",no_argument,NULL,'Q'},
+ {"shell",required_argument,NULL,'s'},
+ {"test",no_argument,NULL,'T'},
+ {"unquoted",no_argument,NULL,'u'},
+ {"alternative",no_argument,NULL,'a'},
+ {"name",required_argument,NULL,'n'},
+ {NULL,0,NULL,0}
};
/* Stop scanning as soon as a non-option argument is found! */
@@ -305,77 +305,77 @@ static const char shortopts[]="+ao:l:n:qQs:Tu";
int getopt_main(int argc, char *argv[])
{
- const char *optstr = NULL;
- char *name = NULL;
- int opt;
- int compatible=0;
-
- init_longopt();
-
- if (getenv("GETOPT_COMPATIBLE"))
- compatible=1;
-
- if (argc == 1) {
- if (compatible) {
- /* For some reason, the original getopt gave no error
- when there were no arguments. */
- printf(" --\n");
- return 0;
- } else
- bb_error_msg_and_die("missing optstring argument");
- }
-
- if (argv[1][0] != '-' || compatible) {
+ const char *optstr = NULL;
+ char *name = NULL;
+ int opt;
+ int compatible=0;
+
+ init_longopt();
+
+ if (getenv("GETOPT_COMPATIBLE"))
+ compatible=1;
+
+ if (argc == 1) {
+ if (compatible) {
+ /* For some reason, the original getopt gave no error
+ when there were no arguments. */
+ printf(" --\n");
+ return 0;
+ } else
+ bb_error_msg_and_die("missing optstring argument");
+ }
+
+ if (argv[1][0] != '-' || compatible) {
char *s;
-
- quote=0;
- s=xmalloc(strlen(argv[1])+1);
- strcpy(s,argv[1]+strspn(argv[1],"-+"));
- argv[1]=argv[0];
- return (generate_output(argv+1,argc-1,s,long_options));
- }
-
- while ((opt=getopt_long(argc,argv,shortopts,longopts,NULL)) != EOF)
- switch (opt) {
- case 'a':
- alternative=1;
- break;
- case 'o':
- optstr = optarg;
- break;
- case 'l':
- add_long_options(optarg);
- break;
- case 'n':
- name = optarg;
- break;
- case 'q':
- quiet_errors=1;
- break;
- case 'Q':
- quiet_output=1;
- break;
- case 's':
- set_shell(optarg);
- break;
- case 'T':
- return 4;
- case 'u':
- quote=0;
- break;
- default:
- bb_show_usage();
- }
-
- if (!optstr) {
- if (optind >= argc)
- bb_error_msg_and_die("missing optstring argument");
- else optstr=argv[optind++];
- }
- if (name)
- argv[optind-1]=name;
- else
- argv[optind-1]=argv[0];
+
+ quote=0;
+ s=xmalloc(strlen(argv[1])+1);
+ strcpy(s,argv[1]+strspn(argv[1],"-+"));
+ argv[1]=argv[0];
+ return (generate_output(argv+1,argc-1,s,long_options));
+ }
+
+ while ((opt=getopt_long(argc,argv,shortopts,longopts,NULL)) != EOF)
+ switch (opt) {
+ case 'a':
+ alternative=1;
+ break;
+ case 'o':
+ optstr = optarg;
+ break;
+ case 'l':
+ add_long_options(optarg);
+ break;
+ case 'n':
+ name = optarg;
+ break;
+ case 'q':
+ quiet_errors=1;
+ break;
+ case 'Q':
+ quiet_output=1;
+ break;
+ case 's':
+ set_shell(optarg);
+ break;
+ case 'T':
+ return 4;
+ case 'u':
+ quote=0;
+ break;
+ default:
+ bb_show_usage();
+ }
+
+ if (!optstr) {
+ if (optind >= argc)
+ bb_error_msg_and_die("missing optstring argument");
+ else optstr=argv[optind++];
+ }
+ if (name)
+ argv[optind-1]=name;
+ else
+ argv[optind-1]=argv[0];
return (generate_output(argv+optind-1,argc-optind+1,optstr,long_options));
}
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
index 5b990df0c..00abe10a6 100644
--- a/util-linux/hwclock.c
+++ b/util-linux/hwclock.c
@@ -67,7 +67,7 @@ static time_t read_rtc(int utc)
if (( rtc = open ( "/dev/misc/rtc", O_RDONLY )) < 0 )
bb_perror_msg_and_die ( "Could not access RTC" );
}
- memset ( &tm, 0, sizeof( struct tm ));
+ memset ( &tm, 0, sizeof( struct tm ));
if ( ioctl ( rtc, RTC_RD_TIME, &tm ) < 0 )
bb_perror_msg_and_die ( "Could not read time from RTC" );
tm. tm_isdst = -1; // not known
@@ -187,10 +187,10 @@ static int check_utc(void)
}
#define HWCLOCK_OPT_LOCALTIME 0x01
-#define HWCLOCK_OPT_UTC 0x02
-#define HWCLOCK_OPT_SHOW 0x04
-#define HWCLOCK_OPT_HCTOSYS 0x08
-#define HWCLOCK_OPT_SYSTOHC 0x10
+#define HWCLOCK_OPT_UTC 0x02
+#define HWCLOCK_OPT_SHOW 0x04
+#define HWCLOCK_OPT_HCTOSYS 0x08
+#define HWCLOCK_OPT_SYSTOHC 0x10
extern int hwclock_main ( int argc, char **argv )
{
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index 9e18752a3..f4abf6839 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -94,7 +94,7 @@ remove_ids(type_id type, int argc, char **argv) {
case MSG:
ret = msgctl (id, IPC_RMID, NULL);
break;
-
+
case SHM:
ret = shmctl (id, IPC_RMID, NULL);
break;
@@ -109,7 +109,7 @@ remove_ids(type_id type, int argc, char **argv) {
argc--;
argv++;
}
-
+
return(nb_errors);
}
@@ -119,7 +119,7 @@ static int deprecated_main(int argc, char **argv)
bb_show_usage();
bb_fflush_stdout_and_exit(1);
}
-
+
if (!strcmp(argv[1], "shm")) {
if (remove_ids(SHM, argc-2, &argv[2]))
bb_fflush_stdout_and_exit(1);
@@ -127,7 +127,7 @@ static int deprecated_main(int argc, char **argv)
else if (!strcmp(argv[1], "msg")) {
if (remove_ids(MSG, argc-2, &argv[2]))
bb_fflush_stdout_and_exit(1);
- }
+ }
else if (!strcmp(argv[1], "sem")) {
if (remove_ids(SEM, argc-2, &argv[2]))
bb_fflush_stdout_and_exit(1);
@@ -228,7 +228,7 @@ int ipcrm_main(int argc, char **argv)
}
result = ((c == 'q') ? msgctl(id, IPC_RMID, NULL) :
- (c == 'm') ? shmctl(id, IPC_RMID, NULL) :
+ (c == 'm') ? shmctl(id, IPC_RMID, NULL) :
semctl(id, 0, IPC_RMID, arg));
if (result < 0) {
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index ea5e412ea..f1463a8e3 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -29,12 +29,12 @@
* 19:30:41 1996 by janl@math.uio.no to add code missing in case PID:
* clauses.
*
- * Patches from Mike Jagdis (jaggy@purplet.demon.co.uk) applied
- * Wed Feb 8 12:12:21 1995 by faith@cs.unc.edu to print numeric uids
+ * Patches from Mike Jagdis (jaggy@purplet.demon.co.uk) applied
+ * Wed Feb 8 12:12:21 1995 by faith@cs.unc.edu to print numeric uids
* if no passwd file entry.
*
* Modified Sat Oct 9 10:55:28 1993 for 0.99.13
- * Original author unknown, may be "krishna balasub@cis.ohio-state.edu"
+ * Original author unknown, may be "krishna balasub@cis.ohio-state.edu"
*
*/
@@ -136,7 +136,7 @@ static void print_msg (int id);
static void print_sem (int id);
int ipcs_main (int argc, char **argv) {
- int opt, msg = 0, sem = 0, shm = 0, id=0, print=0;
+ int opt, msg = 0, sem = 0, shm = 0, id=0, print=0;
char format = 0;
char options[] = "atclupsmqi:ih?";
@@ -173,7 +173,7 @@ int ipcs_main (int argc, char **argv) {
case 'u':
format = STATUS;
break;
- case 'h':
+ case 'h':
case '?':
bb_show_usage();
bb_fflush_stdout_and_exit (0);
@@ -181,11 +181,11 @@ int ipcs_main (int argc, char **argv) {
}
if (print) {
- if (shm) {
+ if (shm) {
print_shm (id);
bb_fflush_stdout_and_exit (0);
}
- if (sem) {
+ if (sem) {
print_sem (id);
bb_fflush_stdout_and_exit (0);
}
@@ -201,15 +201,15 @@ int ipcs_main (int argc, char **argv) {
msg = sem = shm = 1;
bb_printf ("\n");
- if (shm) {
+ if (shm) {
do_shm (format);
bb_printf ("\n");
}
- if (sem) {
+ if (sem) {
do_sem (format);
bb_printf ("\n");
}
- if (msg) {
+ if (msg) {
do_msg (format);
bb_printf ("\n");
}
@@ -258,7 +258,7 @@ void do_shm (char format)
bb_printf ("kernel not configured for shared memory\n");
return;
}
-
+
switch (format) {
case LIMITS:
bb_printf ("------ Shared Memory Limits --------\n");
@@ -282,7 +282,7 @@ void do_shm (char format)
bb_printf ("pages allocated %ld\n", shm_info.shm_tot);
bb_printf ("pages resident %ld\n", shm_info.shm_rss);
bb_printf ("pages swapped %ld\n", shm_info.shm_swp);
- bb_printf ("Swap performance: %ld attempts\t %ld successes\n",
+ bb_printf ("Swap performance: %ld attempts\t %ld successes\n",
shm_info.swap_attempts, shm_info.swap_successes);
return;
@@ -313,7 +313,7 @@ void do_shm (char format)
for (id = 0; id <= maxid; id++) {
shmid = shmctl (id, SHM_STAT, &shmseg);
- if (shmid < 0)
+ if (shmid < 0)
continue;
if (format == CREATOR) {
print_perms (shmid, ipcp);
@@ -321,7 +321,7 @@ void do_shm (char format)
}
pw = getpwuid(ipcp->uid);
switch (format) {
- case TIME:
+ case TIME:
if (pw)
bb_printf ("%-10d %-10.10s", shmid, pw->pw_name);
else
@@ -342,14 +342,14 @@ void do_shm (char format)
bb_printf (" %-10d %-10d\n",
shmseg.shm_cpid, shmseg.shm_lpid);
break;
-
+
default:
bb_printf("0x%08x ",ipcp->KEY );
if (pw)
bb_printf ("%-10d %-10.10s", shmid, pw->pw_name);
else
bb_printf ("%-10d %-10d", shmid, ipcp->uid);
- bb_printf ("%-10o %-10lu %-10ld %-6s %-6s\n",
+ bb_printf ("%-10o %-10lu %-10ld %-6s %-6s\n",
ipcp->mode & 0777,
/*
* earlier: int, Austin has size_t
@@ -384,7 +384,7 @@ void do_sem (char format)
bb_printf ("kernel not configured for semaphores\n");
return;
}
-
+
switch (format) {
case LIMITS:
bb_printf ("------ Semaphore Limits --------\n");
@@ -421,7 +421,7 @@ void do_sem (char format)
default:
bb_printf ("------ Semaphore Arrays --------\n");
- bb_printf ("%-10s %-10s %-10s %-10s %-10s\n",
+ bb_printf ("%-10s %-10s %-10s %-10s %-10s\n",
"key","semid","owner","perms","nsems");
break;
}
@@ -437,7 +437,7 @@ void do_sem (char format)
}
pw = getpwuid(ipcp->uid);
switch (format) {
- case TIME:
+ case TIME:
if (pw)
bb_printf ("%-8d %-10.10s", semid, pw->pw_name);
else
@@ -449,7 +449,7 @@ void do_sem (char format)
break;
case PID:
break;
-
+
default:
bb_printf("0x%08x ", ipcp->KEY);
if (pw)
@@ -484,7 +484,7 @@ void do_msg (char format)
bb_printf ("kernel not configured for message queues\n");
return;
}
-
+
switch (format) {
case LIMITS:
if ((msgctl (0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0 )
@@ -662,7 +662,7 @@ void print_sem (int semid)
bb_printf ("nsems = %ld\n", (long) semds.sem_nsems);
bb_printf ("otime = %-26.24s\n",
semds.sem_otime ? ctime (&semds.sem_otime) : "Not set");
- bb_printf ("ctime = %-26.24s\n", ctime (&semds.sem_ctime));
+ bb_printf ("ctime = %-26.24s\n", ctime (&semds.sem_ctime));
bb_printf ("%-10s %-10s %-10s %-10s %-10s\n",
"semnum","value","ncount","zcount","pid");
diff --git a/util-linux/losetup.c b/util-linux/losetup.c
index f03889663..c2d3339e0 100644
--- a/util-linux/losetup.c
+++ b/util-linux/losetup.c
@@ -31,16 +31,16 @@ die_failed:
case -1:
/* losetup takes two argument:, loop_device and file */
if(optind+2==argc) {
- if(set_loop(&argv[optind], argv[optind + 1], offset)>=0)
- return EXIT_SUCCESS;
- else goto die_failed;
+ if(set_loop(&argv[optind], argv[optind + 1], offset)>=0)
+ return EXIT_SUCCESS;
+ else goto die_failed;
}
if(optind+1==argc) {
- char *s=query_loop(argv[optind]);
- if (!s) goto die_failed;
- printf("%s: %s\n",argv[optind],s);
- if(ENABLE_FEATURE_CLEAN_UP) free(s);
- return EXIT_SUCCESS;
+ char *s=query_loop(argv[optind]);
+ if (!s) goto die_failed;
+ printf("%s: %s\n",argv[optind],s);
+ if(ENABLE_FEATURE_CLEAN_UP) free(s);
+ return EXIT_SUCCESS;
}
break;
}
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index a18e44835..b8c0090fa 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -1,7 +1,7 @@
/* vi:set ts=4:
- *
+ *
* mdev - Mini udev for busybox
- *
+ *
* Copyright 2005 Rob Landley <rob@landley.net>
* Copyright 2005 Frank Sorenson <frank@tuxrocks.com>
*
@@ -38,21 +38,21 @@ static void make_device(char *path)
RESERVE_CONFIG_BUFFER(temp,PATH_MAX);
/* Try to read major/minor string */
-
+
snprintf(temp, PATH_MAX, "%s/dev", path);
fd = open(temp, O_RDONLY);
len = read(fd, temp, PATH_MAX-1);
if (len<1) goto end;
close(fd);
-
+
/* Determine device name, type, major and minor */
-
+
device_name = strrchr(path, '/') + 1;
type = strncmp(path+5, "block/" ,6) ? S_IFCHR : S_IFBLK;
if(sscanf(temp, "%d:%d", &major, &minor) != 2) goto end;
/* If we have a config file, look up permissions for this device */
-
+
if (ENABLE_FEATURE_MDEV_CONF) {
char *conf,*pos,*end;
@@ -67,7 +67,7 @@ static void make_device(char *path)
for (pos=conf;pos-conf<len;) {
int field;
char *end2;
-
+
line++;
/* find end of this line */
for(end=pos;end-conf<len && *end!='\n';end++);
@@ -88,11 +88,11 @@ static void make_device(char *path)
regmatch_t off;
int result;
- /* Is this it? */
+ /* Is this it? */
xregcomp(&match,regex,REG_EXTENDED);
result=regexec(&match,device_name,1,&off,0);
regfree(&match);
-
+
/* If not this device, skip rest of line */
if(result || off.rm_so
|| off.rm_eo!=strlen(device_name))
@@ -159,7 +159,7 @@ found_device:
bb_perror_msg_and_die("mknod %s failed", temp);
if (ENABLE_FEATURE_MDEV_CONF) chown(temp,uid,gid);
-
+
end:
RELEASE_CONFIG_BUFFER(temp);
}
@@ -177,7 +177,7 @@ static void find_dev(char *path)
for (;;) {
struct dirent *entry = readdir(dir);
-
+
if (!entry) break;
/* Skip "." and ".." (also skips hidden files, which is ok) */
@@ -189,12 +189,12 @@ static void find_dev(char *path)
find_dev(path);
path[len] = 0;
}
-
+
/* If there's a dev entry, mknod it */
-
+
if (!strcmp(entry->d_name, "dev")) make_device(path);
}
-
+
closedir(dir);
}
@@ -205,7 +205,7 @@ int mdev_main(int argc, char *argv[])
RESERVE_CONFIG_BUFFER(temp,PATH_MAX);
/* Scan */
-
+
if (argc == 2 && !strcmp(argv[1],"-s")) {
strcpy(temp,"/sys/block");
find_dev(temp);
@@ -218,7 +218,7 @@ int mdev_main(int argc, char *argv[])
action = getenv("ACTION");
env_path = getenv("DEVPATH");
if (!action || !env_path) bb_show_usage();
-
+
if (!strcmp(action, "add")) {
sprintf(temp, "/sys%s", env_path);
make_device(temp);
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 4777e470b..68542f9bc 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -32,7 +32,7 @@
/* Consume standard mount options (from -o options or --options).
* Set appropriate flags and collect unrecognized ones as a comma separated
- * string to pass to kernel */
+ * string to pass to kernel */
struct {
const char *name;
@@ -104,7 +104,7 @@ extern int mount_main(int argc, char **argv)
*loopFile = 0, *buf = 0,
*files[] = {"/etc/filesystems", "/proc/filesystems", 0};
int i, opt, all = FALSE, fakeIt = FALSE, allowWrite = FALSE,
- rc = 1, useMtab = ENABLE_FEATURE_MTAB_SUPPORT;
+ rc = 1, useMtab = ENABLE_FEATURE_MTAB_SUPPORT;
int flags=0xc0ed0000; // Needed for linux 2.2, ignored by 2.4 and 2.6.
FILE *file = 0,*f = 0;
char path[PATH_MAX*2];
@@ -185,7 +185,7 @@ extern int mount_main(int argc, char **argv)
statbuf.st_mode=0;
if(optind < argc)
blockDevice = !stat(argv[optind], &statbuf) ?
- bb_simplify_path(argv[optind]) :
+ bb_simplify_path(argv[optind]) :
(ENABLE_FEATURE_CLEAN_UP ? strdup(argv[optind]) : argv[optind]);
if(optind+1 < argc) directory = bb_simplify_path(argv[optind+1]);
@@ -206,7 +206,7 @@ extern int mount_main(int argc, char **argv)
bb_perror_msg("Can't find %s in /etc/fstab\n", blockDevice);
break;
}
-
+
// If we're mounting all and all doesn't mount this one, skip it.
if(all) {
@@ -271,7 +271,7 @@ singlemount:
goto mount_it_now;
}
} else {
-
+
// Do we need to allocate a loopback device?
if(ENABLE_FEATURE_MOUNT_LOOP && !fakeIt && S_ISREG(statbuf.st_mode))
@@ -297,7 +297,7 @@ singlemount:
if(fsType || (flags & (MS_REMOUNT | MS_BIND | MS_MOVE)))
goto mount_it_now;
}
-
+
// Loop through filesystem types until mount succeeds or we run out
for(i = 0; files[i] && rc; i++) {
@@ -305,11 +305,11 @@ singlemount:
if(!f) continue;
// Get next block device backed filesystem
for(buf = 0; (buf = fsType = bb_get_chomped_line_from_file(f));
- free(buf))
+ free(buf))
{
// Skip funky entries in /proc
if(!strncmp(buf,"nodev",5) && isspace(buf[5])) continue;
-
+
while(isspace(*fsType)) fsType++;
if(*buf=='#' || *buf=='*') continue;
if(!*fsType) continue;
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index 75f341a92..e9d6dc635 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -151,11 +151,11 @@ static const int MS_NODIRATIME = 2048; /* Do not update directory access time
#define NFS_MOUNT_VERSION 4
struct nfs2_fh {
- char data[32];
+ char data[32];
};
struct nfs3_fh {
- unsigned short size;
- unsigned char data[64];
+ unsigned short size;
+ unsigned char data[64];
};
struct nfs_mount_data {
@@ -687,7 +687,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
mountprog,
mountvers,
proto,
- mountport);
+ mountport);
/* contact the mount daemon via TCP */
mount_server_addr.sin_port = htons(pm_mnt->pm_port);
@@ -810,7 +810,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
if (tcp) {
if (nfs_mount_version < 3) {
- printf(_("NFS over TCP is not supported.\n"));
+ printf(_("NFS over TCP is not supported.\n"));
goto fail;
}
fsock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index 85e180c46..c86e73cc1 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -16,7 +16,7 @@ extern int pivot_root(const char * new_root,const char * put_old);
int pivot_root_main(int argc, char **argv)
{
if (argc != 3)
- bb_show_usage();
+ bb_show_usage();
if (pivot_root(argv[1],argv[2]) < 0)
bb_perror_msg_and_die("pivot_root");
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index cabcc7dbe..2b011ebb0 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -55,7 +55,7 @@ static time_t askremotedate(const char *host)
* the RFC 868 time 2,208,988,800 corresponds to 00:00 1 Jan 1970 GMT
* Subtract the RFC 868 time to get Linux epoch
*/
-
+
return(ntohl(nett) - RFC_868_BIAS);
}
@@ -63,10 +63,10 @@ int rdate_main(int argc, char **argv)
{
time_t remote_time;
unsigned long flags;
-
+
bb_opt_complementally = "-1";
flags = bb_getopt_ulflags(argc, argv, "sp");
-
+
remote_time = askremotedate(argv[optind]);
if (flags & 1) {
@@ -78,9 +78,9 @@ int rdate_main(int argc, char **argv)
else
if (stime(&remote_time) < 0)
bb_perror_msg_and_die("Could not set time of day");
-
+
/* No need to check for the -p flag as it's the only option left */
-
+
} else printf("%s", ctime(&remote_time));
return EXIT_SUCCESS;
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index 80716d9f0..1612d7147 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -149,9 +149,9 @@ int readprofile_main(int argc, char **argv)
/*
* Use an fd for the profiling buffer, to skip stdio overhead
*/
-
+
proFd = bb_xopen(proFile,O_RDONLY);
-
+
if (((int)(len=lseek(proFd,0,SEEK_END)) < 0)
|| (lseek(proFd,0,SEEK_SET) < 0))
bb_perror_msg_and_die(proFile);
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 0c86eec08..bcc4443ab 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -47,20 +47,20 @@ static void delete_contents(char *directory)
// Skip . and ..
if(*newdir=='.' && (!newdir[1] || (newdir[1]=='.' && !newdir[2])))
continue;
-
+
// Recurse to delete contents
newdir = alloca(strlen(directory) + strlen(d->d_name) + 2);
sprintf(newdir, "%s/%s", directory, d->d_name);
delete_contents(newdir);
}
closedir(dir);
-
+
// Directory should now be empty. Zap it.
rmdir(directory);
}
-
+
// It wasn't a directory. Zap it.
-
+
} else unlink(directory);
}
@@ -74,18 +74,18 @@ int switch_root_main(int argc, char *argv[])
bb_opt_complementally="-2";
bb_getopt_ulflags(argc,argv,"c:",&console);
-
+
// Change to new root directory and verify it's a different fs.
newroot=argv[optind++];
-
+
if (chdir(newroot) || stat(".", &st1) || stat("/", &st2) ||
st1.st_dev == st2.st_dev)
{
bb_error_msg_and_die("bad newroot %s",newroot);
}
rootdev=st2.st_dev;
-
+
// Additional sanity checks: we're about to rm -rf /, so be REALLY SURE
// we mean it. (I could make this a CONFIG option, but I would get email
// from all the people who WILL eat their filesystemss.)
@@ -100,13 +100,13 @@ int switch_root_main(int argc, char *argv[])
// Zap everything out of rootdev
delete_contents("/");
-
+
// Overmount / with newdir and chroot into it. The chdir is needed to
// recalculate "." and ".." links.
if (mount(".", "/", NULL, MS_MOVE, NULL) || chroot(".") || chdir("/"))
bb_error_msg_and_die("moving root");
-
+
// If a new console specified, redirect stdin/stdout/stderr to that.
if (console) {