Date: Wed, 16 Mar 2022 23:30:33 GMT From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 47b50c23185b - releng/13.1 - Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. Message-ID: <202203162330.22GNUXws042741@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/13.1 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=47b50c23185bed6759e5ce1345dba45e5ca703a3 commit 47b50c23185bed6759e5ce1345dba45e5ca703a3 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2022-03-16 18:37:15 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2022-03-16 23:14:57 +0000 Ensure that fsck(8) / fsck_ffs(8) produces the correct exit code for missing devices. PR: 262580 Approved by: re (gjb, early MFC) (cherry picked from commit 2983ec0a87a18943564548c5c00c879c8db83edf) (cherry picked from commit 934ba51bc929ee23248353a081a4cc4327a4ec54) --- sbin/fsck_ffs/setup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 45662636557d..14b34962d3fe 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -219,10 +219,8 @@ openfilesys(char *dev) struct stat statb; int saved_fsreadfd; - if (stat(dev, &statb) < 0) { - pfatal("CANNOT STAT %s: %s\n", dev, strerror(errno)); + if (stat(dev, &statb) < 0) return (0); - } if ((statb.st_mode & S_IFMT) != S_IFCHR && (statb.st_mode & S_IFMT) != S_IFBLK) { if (bkgrdflag != 0 && (statb.st_flags & SF_SNAPSHOT) == 0) { @@ -240,7 +238,6 @@ openfilesys(char *dev) saved_fsreadfd = fsreadfd; if ((fsreadfd = open(dev, O_RDONLY)) < 0) { fsreadfd = saved_fsreadfd; - pfatal("CANNOT OPEN %s: %s\n", dev, strerror(errno)); return (0); } if (saved_fsreadfd != -1)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203162330.22GNUXws042741>