Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 2020 18:50:26 +0000 (UTC)
From:      Chuck Silvers <chs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365056 - head/sbin/fsck_ffs
Message-ID:  <202009011850.081IoQqj024006@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: chs
Date: Tue Sep  1 18:50:26 2020
New Revision: 365056
URL: https://svnweb.freebsd.org/changeset/base/365056

Log:
  Move all of the error prints in readsb() from stderr to stdout.
  The only output from fsck that should go to stderr is the usage message.
  if setup() fails then exit with EEXIT rather than 0.
  
  Reviewed by:	mckusick
  Sponsored by:	Netflix

Modified:
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/setup.c

Modified: head/sbin/fsck_ffs/main.c
==============================================================================
--- head/sbin/fsck_ffs/main.c	Tue Sep  1 16:20:42 2020	(r365055)
+++ head/sbin/fsck_ffs/main.c	Tue Sep  1 18:50:26 2020	(r365056)
@@ -408,7 +408,7 @@ checkfilesys(char *filesys)
 	case 0:
 		if (preen)
 			pfatal("CAN'T CHECK FILE SYSTEM.");
-		return (0);
+		return (EEXIT);
 	case -1:
 	clean:
 		pwarn("clean, %ld free ", (long)(sblock.fs_cstotal.cs_nffree +

Modified: head/sbin/fsck_ffs/setup.c
==============================================================================
--- head/sbin/fsck_ffs/setup.c	Tue Sep  1 16:20:42 2020	(r365055)
+++ head/sbin/fsck_ffs/setup.c	Tue Sep  1 18:50:26 2020	(r365056)
@@ -339,15 +339,15 @@ readsb(int listerr)
 			return (0);
 		case ENOENT:
 			if (bflag)
-				fprintf(stderr, "%jd is not a file system "
+				printf("%jd is not a file system "
 				    "superblock\n", super / dev_bsize);
 			else
-				fprintf(stderr, "Cannot find file system "
+				printf("Cannot find file system "
 				    "superblock\n");
 			return (0);
 		case EIO:
 		default:
-			fprintf(stderr, "I/O error reading %jd\n",
+			printf("I/O error reading %jd\n",
 			    super / dev_bsize);
 			return (0);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009011850.081IoQqj024006>