*: remove some uses of argc
[oweals/busybox.git] / e2fsprogs / old_e2fsprogs / fsck.c
index a51c33a1cad9b6648287051fd2e83a3dde34c8b2..687938c24c82e95e684f13f4c6cb54257edd5974 100644 (file)
  * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  *      2001, 2002, 2003, 2004, 2005 by  Theodore Ts'o.
  *
- * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
- * %End-Header%
+ * Licensed under GPLv2, see file LICENSE in this tarball for details.
  */
 
 #include <sys/types.h>
@@ -285,7 +282,7 @@ static char *string_copy(const char *s)
 
        if (!s)
                return 0;
-       ret = strdup(s);
+       ret = xstrdup(s);
        return ret;
 }
 
@@ -533,21 +530,21 @@ static struct fs_info *lookup(char *filesys)
 /* Find fsck program for a given fs type. */
 static char *find_fsck(char *type)
 {
-  char *s;
-  const char *tpl;
-  char *p = string_copy(fsck_path);
-  struct stat st;
+       char *s;
+       const char *tpl;
+       char *p = string_copy(fsck_path);
+       struct stat st;
 
-  /* Are we looking for a program or just a type? */
-  tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
+       /* Are we looking for a program or just a type? */
+       tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
 
-  for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
-       s = xasprintf(tpl, s, type);
-       if (stat(s, &st) == 0) break;
-       free(s);
-  }
-  free(p);
-  return s;
+       for (s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
+               s = xasprintf(tpl, s, type);
+               if (stat(s, &st) == 0) break;
+               free(s);
+       }
+       free(p);
+       return s;
 }
 
 static int progress_active(void)
@@ -885,7 +882,7 @@ static void compile_fs_type(char *fs_type, struct fs_type_compile *cmp)
        list = string_copy(fs_type);
        num = 0;
        s = strtok(list, ",");
-       while(s) {
+       while (s) {
                negate = 0;
                if (strncmp(s, "no", 2) == 0) {
                        s += 2;
@@ -930,7 +927,7 @@ static int opt_in_list(char *opt, char *optlist)
        list = string_copy(optlist);
 
        s = strtok(list, ",");
-       while(s) {
+       while (s) {
                if (strcmp(s, opt) == 0) {
                        free(list);
                        return 1;
@@ -1004,7 +1001,7 @@ static int ignore(struct fs_info *fs)
        s = find_fsck(fs->type);
        if (s == NULL) {
                if (wanted)
-                       bb_error_msg("cannot check %s: fsck.%s not found",
+                       bb_error_msg("can't check %s: fsck.%s not found",
                                fs->device, fs->type);
                return 1;
        }
@@ -1206,7 +1203,7 @@ static void PRS(int argc, char **argv)
                                 * /proc/partitions isn't found.
                                 */
                                if (access("/proc/partitions", R_OK) < 0) {
-                                       bb_perror_msg_and_die("cannot open /proc/partitions "
+                                       bb_perror_msg_and_die("can't open /proc/partitions "
                                                        "(is /proc mounted?)");
                                }
                                /*
@@ -1218,7 +1215,7 @@ static void PRS(int argc, char **argv)
                "must be root to scan for matching filesystems: %s\n", arg);
                                else
                                        bb_error_msg_and_die(
-               "cannot find matching filesystem: %s", arg);
+               "can't find matching filesystem: %s", arg);
                        }
                        devices[num_devices++] = dev ? dev : string_copy(arg);
                        continue;