+1999-01-01 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * fsck.c (load_fs_info, parse_fstab_line): Ignore fstab lines
+ are commented out. Also allow blank lines in the
+ /etc/fstab file.
+ (execute): In verbose mode, print the mountpount of the
+ filesystem which we are checking (user request).
+
+1998-12-30 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * mke2fs.c: Add definition of SCSI_BLK_MAJOR if not defined, for
+ compatibility with Linux 1.2.13 header files.
+
1998-12-15 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Release of E2fsprogs 1.13
return;
}
-struct fs_info *parse_fstab_line(char *line)
+int parse_fstab_line(char *line, struct fs_info **ret_fs)
{
char *device, *mntpnt, *type, *opts, *freq, *passno, *cp;
struct fs_info *fs;
+ *ret_fs = 0;
strip_line(line);
+ if (cp = strchr(line, '#'))
+ *cp = 0; /* Ignore everything after the comment char */
cp = line;
device = parse_word(&cp);
freq = parse_word(&cp);
passno = parse_word(&cp);
- if (!device || !mntpnt || !type)
- return 0;
+ if (!device)
+ return 0; /* Allow blank lines */
+
+ if (!mntpnt || !type)
+ return -1;
if (!(fs = malloc(sizeof(struct fs_info))))
- return 0;
+ return -1;
fs->device = string_copy(device);
fs->mountpt = string_copy(mntpnt);
fs->flags = 0;
fs->next = NULL;
- return fs;
+ *ret_fs = fs;
+
+ return 0;
}
/*
if (!fgets(buf, sizeof(buf), f))
break;
buf[sizeof(buf)-1] = 0;
- if ((fs = parse_fstab_line(buf)) == NULL) {
+ if (parse_fstab_line(buf, &fs) < 0) {
fprintf(stderr, "WARNING: bad format "
"on line %d of %s\n", lineno, filename);
continue;
}
+ if (!fs)
+ continue;
if (!filesys_info)
filesys_info = fs;
else
* Execute a particular fsck program, and link it into the list of
* child processes we are waiting for.
*/
-static int execute(char *prog, char *device)
+static int execute(char *prog, char *device, char *mntpt)
{
char *s, *argv[80];
int argc, i;
}
if (verbose || noexecute) {
- printf("[%s] ", s);
+ printf("[%s -- %s] ", s, mntpt);
for (i=0; i < argc; i++)
printf("%s ", argv[i]);
printf("\n");
type = DEFAULT_FSTYPE;
sprintf(prog, "fsck.%s", type);
- retval = execute(prog, device);
+ retval = execute(prog, device, fsent->mountpt);
if (retval) {
fprintf(stderr, "%s: Error %d while executing %s for %s\n",
progname, retval, prog, device);