bin/46672: dump(8) program gives unnecessary -L warning
Jason Young
jyoung8607 at hotmail.com
Tue Sep 2 00:10:17 PDT 2003
The following reply was made to PR bin/46672; it has been noted by GNATS.
From: "Jason Young" <jyoung8607 at hotmail.com>
To: freebsd-gnats-submit at FreeBSD.org, swear at attbi.com
Cc:
Subject: Re: bin/46672: dump(8) program gives unnecessary -L warning
Date: Tue, 02 Sep 2003 02:07:09 -0500
Here is a patch to dump(8) that eliminates the warning for filesystems
mounted readonly, and modifies the warning to include only read-write
filesystems.
*** main.c.orig Tue Sep 2 01:26:49 2003
--- main.c Tue Sep 2 01:59:09 2003
***************
*** 311,324 ****
}
spcl.c_dev[NAMELEN-1]='\0';
spcl.c_filesys[NAMELEN-1]='\0';
if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
! if (snapdump == 0) {
! msg("WARNING: %s\n",
! "should use -L when dumping live filesystems!");
! } else {
struct ufs_args args;
char snapname[BUFSIZ];
snprintf(snapname, sizeof snapname,
"%s/.dump_snapshot",
mntpt);
--- 311,321 ----
}
spcl.c_dev[NAMELEN-1]='\0';
spcl.c_filesys[NAMELEN-1]='\0';
if ((mntpt = getmntpt(disk, &mntflags)) != 0) {
! if (snapdump == 1) {
struct ufs_args args;
char snapname[BUFSIZ];
snprintf(snapname, sizeof snapname,
"%s/.dump_snapshot",
mntpt);
***************
*** 338,347 ****
--- 335,347 ----
}
unlink(snapname);
if (fstat(diskfd, &sb) != 0)
err(X_STARTUP, "%s: stat", snapname);
spcl.c_date = _time_to_time64(sb.st_mtime);
+ } else if(!(mntflags & MNT_RDONLY)) {
+ msg("WARNING: %s\n",
+ "should use -L when dumping live r/w
filesystems!");
}
} else if (snapdump != 0) {
msg("WARNING: Cannot use -L on an unmounted filesystem.\n");
snapdump = 0;
}
_________________________________________________________________
Get MSN 8 and enjoy automatic e-mail virus protection.
http://join.msn.com/?page=features/virus
More information about the freebsd-bugs
mailing list