Module Name: src Committed By: snj Date: Thu Jul 30 15:36:03 UTC 2015
Modified Files: src/sbin/newfs [netbsd-7]: newfs.c src/usr.sbin/installboot [netbsd-7]: installboot.c Log Message: Pull up following revision(s) (requested by mlelstv in ticket #900): sbin/newfs/newfs.c: revision 1.113 usr.sbin/installboot/installboot.c: revision 1.39 Handle getfsspecname errors. To generate a diff of this commit: cvs rdiff -u -r1.111.10.1 -r1.111.10.2 src/sbin/newfs/newfs.c cvs rdiff -u -r1.36.18.1 -r1.36.18.2 src/usr.sbin/installboot/installboot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/newfs/newfs.c diff -u src/sbin/newfs/newfs.c:1.111.10.1 src/sbin/newfs/newfs.c:1.111.10.2 --- src/sbin/newfs/newfs.c:1.111.10.1 Tue Nov 11 10:21:25 2014 +++ src/sbin/newfs/newfs.c Thu Jul 30 15:36:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: newfs.c,v 1.111.10.1 2014/11/11 10:21:25 martin Exp $ */ +/* $NetBSD: newfs.c,v 1.111.10.2 2015/07/30 15:36:03 snj Exp $ */ /* * Copyright (c) 1983, 1989, 1993, 1994 @@ -78,7 +78,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: newfs.c,v 1.111.10.1 2014/11/11 10:21:25 martin Exp $"); +__RCSID("$NetBSD: newfs.c,v 1.111.10.2 2015/07/30 15:36:03 snj Exp $"); #endif #endif /* not lint */ @@ -493,9 +493,11 @@ main(int argc, char *argv[]) fso = fsi; } } else { /* !Fflag && !mfs */ - special = getfsspecname(specname, sizeof(specname), special); - raw = getdiskrawname(rawname, sizeof(rawname), special); - if (raw != NULL) + raw = getfsspecname(specname, sizeof(specname), special); + if (raw == NULL) + err(1, "%s: %s", special, specname); + special = getdiskrawname(rawname, sizeof(rawname), raw); + if (special == NULL) special = raw; fsi = opendisk(special, O_RDONLY, device, sizeof(device), 0); Index: src/usr.sbin/installboot/installboot.c diff -u src/usr.sbin/installboot/installboot.c:1.36.18.1 src/usr.sbin/installboot/installboot.c:1.36.18.2 --- src/usr.sbin/installboot/installboot.c:1.36.18.1 Thu Jul 16 21:36:59 2015 +++ src/usr.sbin/installboot/installboot.c Thu Jul 30 15:36:03 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: installboot.c,v 1.36.18.1 2015/07/16 21:36:59 snj Exp $ */ +/* $NetBSD: installboot.c,v 1.36.18.2 2015/07/30 15:36:03 snj Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if !defined(__lint) -__RCSID("$NetBSD: installboot.c,v 1.36.18.1 2015/07/16 21:36:59 snj Exp $"); +__RCSID("$NetBSD: installboot.c,v 1.36.18.2 2015/07/30 15:36:03 snj Exp $"); #endif /* !__lint */ #include <sys/param.h> @@ -240,6 +240,8 @@ main(int argc, char *argv[]) #if !HAVE_NBTOOL_CONFIG_H special = getfsspecname(specname, sizeof(specname), argv[0]); + if (special == NULL) + err(1, "%s: %s", argv[0], specname); raw = getdiskrawname(rawname, sizeof(rawname), special); if (raw != NULL) special = raw;