Module Name: src
Committed By: mlelstv
Date: Sat Feb 20 08:47:10 UTC 2010
Modified Files:
src/sbin/gpt: gpt.c
Log Message:
Initialize device_name before opendisk to avoid
"unable to open device '(null)'" error messages
when the opendisk fails.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/gpt.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/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.9 src/sbin/gpt/gpt.c:1.10
--- src/sbin/gpt/gpt.c:1.9 Sat Feb 7 18:12:22 2009
+++ src/sbin/gpt/gpt.c Sat Feb 20 08:47:10 2010
@@ -31,7 +31,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.9 2009/02/07 18:12:22 uebayasi Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.10 2010/02/20 08:47:10 mlelstv Exp $");
#endif
#include <sys/param.h>
@@ -676,10 +676,10 @@
found:
#endif
#ifdef __NetBSD__
+ device_name = device_path + strlen(_PATH_DEV);
fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
if (fd == -1)
return -1;
- device_name = device_path + strlen(_PATH_DEV);
#endif
if (fstat(fd, &sb) == -1)