Module Name:    src
Committed By:   tsutsui
Date:           Sun Jun 14 18:24:21 UTC 2020

Modified Files:
        src/usr.sbin/mdsetimage: mdsetimage.c

Log Message:
Explicitly print a fs image filename on "fs image is too big" errors.

This will help future analysis of build errors caused by bloated
embedded ramdisk images and possible but unexpected other binaries.

Proposed on port-mips@ in discusson about ews4800mips daily build errors:
 https://mail-index.netbsd.org/port-mips/2020/06/14/msg000950.html
and "Yes please!" from martin@.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/mdsetimage/mdsetimage.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mdsetimage/mdsetimage.c
diff -u src/usr.sbin/mdsetimage/mdsetimage.c:1.24 src/usr.sbin/mdsetimage/mdsetimage.c:1.25
--- src/usr.sbin/mdsetimage/mdsetimage.c:1.24	Sun Dec 18 18:32:24 2016
+++ src/usr.sbin/mdsetimage/mdsetimage.c	Sun Jun 14 18:24:21 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdsetimage.c,v 1.24 2016/12/18 18:32:24 riastradh Exp $	*/
+/*	$NetBSD: mdsetimage.c,v 1.25 2020/06/14 18:24:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1996, 2002 Christopher G. Demetriou
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1996\
  Christopher G. Demetriou.  All rights reserved.");
-__RCSID("$NetBSD: mdsetimage.c,v 1.24 2016/12/18 18:32:24 riastradh Exp $");
+__RCSID("$NetBSD: mdsetimage.c,v 1.25 2020/06/14 18:24:21 tsutsui Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -166,10 +166,10 @@ main(int argc, char *argv[])
 		if (fstat(fsfd, &fssb) == -1)
 			err(1, "fstat %s", fsfile);
 		if ((uintmax_t)fssb.st_size != (size_t)fssb.st_size)
-			errx(1, "fs image is too big");
+			errx(1, "fs image %s is too big", fsfile);
 		if (fssb.st_size > md_root_size_value)
-			errx(1, "fs image (%jd bytes) too big for buffer"
-			    " (%u bytes)", (intmax_t) fssb.st_size,
+			errx(1, "fs image %s (%jd bytes) too big for buffer"
+			    " (%u bytes)", fsfile, (intmax_t) fssb.st_size,
 			    md_root_size_value);
 		left_to_copy = fssb.st_size;
 	}

Reply via email to