Module Name:    src
Committed By:   pooka
Date:           Wed Feb  9 11:22:49 UTC 2011

Modified Files:
        src/sbin/raidctl: prog_ops.h raidctl.c raidctl_hostops.c
            raidctl_rumpops.c

Log Message:
Exterminate a bug I created in 2009.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/raidctl/prog_ops.h \
    src/sbin/raidctl/raidctl_hostops.c src/sbin/raidctl/raidctl_rumpops.c
cvs rdiff -u -r1.50 -r1.51 src/sbin/raidctl/raidctl.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/raidctl/prog_ops.h
diff -u src/sbin/raidctl/prog_ops.h:1.1 src/sbin/raidctl/prog_ops.h:1.2
--- src/sbin/raidctl/prog_ops.h:1.1	Wed Dec 15 18:37:55 2010
+++ src/sbin/raidctl/prog_ops.h	Wed Feb  9 11:22:49 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: prog_ops.h,v 1.1 2010/12/15 18:37:55 pooka Exp $	*/
+/*      $NetBSD: prog_ops.h,v 1.2 2011/02/09 11:22:49 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -37,6 +37,7 @@
 
 	int (*op_open)(const char *, int, ...);
 	int (*op_ioctl)(int, unsigned long, ...);
+	int (*op_fstat)(int, struct stat *);
 	int (*op_close)(int);
 };
 extern const struct prog_ops prog_ops;
@@ -44,11 +45,13 @@
 #define prog_init prog_ops.op_init
 #define prog_open prog_ops.op_open
 #define prog_ioctl prog_ops.op_ioctl
+#define prog_fstat prog_ops.op_fstat
 #define prog_close prog_ops.op_close
 #else
 #define prog_init ((int (*)(void))NULL)
 #define prog_open open
 #define prog_ioctl ioctl
+#define prog_fstat fstat
 #define prog_close close
 #endif
 
Index: src/sbin/raidctl/raidctl_hostops.c
diff -u src/sbin/raidctl/raidctl_hostops.c:1.1 src/sbin/raidctl/raidctl_hostops.c:1.2
--- src/sbin/raidctl/raidctl_hostops.c:1.1	Wed Dec 15 18:37:55 2010
+++ src/sbin/raidctl/raidctl_hostops.c	Wed Feb  9 11:22:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: raidctl_hostops.c,v 1.1 2010/12/15 18:37:55 pooka Exp $	*/
+/*	$NetBSD: raidctl_hostops.c,v 1.2 2011/02/09 11:22:49 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: raidctl_hostops.c,v 1.1 2010/12/15 18:37:55 pooka Exp $");
+__RCSID("$NetBSD: raidctl_hostops.c,v 1.2 2011/02/09 11:22:49 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -42,5 +42,6 @@
 const struct prog_ops prog_ops = {
 	.op_open = open,
 	.op_ioctl = ioctl,
+	.op_fstat = fstat,
 	.op_close = close,
 };
Index: src/sbin/raidctl/raidctl_rumpops.c
diff -u src/sbin/raidctl/raidctl_rumpops.c:1.1 src/sbin/raidctl/raidctl_rumpops.c:1.2
--- src/sbin/raidctl/raidctl_rumpops.c:1.1	Wed Dec 15 18:37:55 2010
+++ src/sbin/raidctl/raidctl_rumpops.c	Wed Feb  9 11:22:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: raidctl_rumpops.c,v 1.1 2010/12/15 18:37:55 pooka Exp $	*/
+/*	$NetBSD: raidctl_rumpops.c,v 1.2 2011/02/09 11:22:49 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: raidctl_rumpops.c,v 1.1 2010/12/15 18:37:55 pooka Exp $");
+__RCSID("$NetBSD: raidctl_rumpops.c,v 1.2 2011/02/09 11:22:49 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -44,5 +44,6 @@
 
 	.op_open =	rump_sys_open,
 	.op_ioctl =	rump_sys_ioctl,
+	.op_fstat =	rump_sys_fstat,
 	.op_close =	rump_sys_close,
 };

Index: src/sbin/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.50 src/sbin/raidctl/raidctl.c:1.51
--- src/sbin/raidctl/raidctl.c:1.50	Wed Dec 15 18:37:55 2010
+++ src/sbin/raidctl/raidctl.c	Wed Feb  9 11:22:49 2011
@@ -1,4 +1,4 @@
-/*      $NetBSD: raidctl.c,v 1.50 2010/12/15 18:37:55 pooka Exp $   */
+/*      $NetBSD: raidctl.c,v 1.51 2011/02/09 11:22:49 pooka Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: raidctl.c,v 1.50 2010/12/15 18:37:55 pooka Exp $");
+__RCSID("$NetBSD: raidctl.c,v 1.51 2011/02/09 11:22:49 pooka Exp $");
 #endif
 
 
@@ -265,7 +265,7 @@
 	    prog_open);
 	if (fd == -1)
 		err(1, "Unable to open device file: %s", name);
-	if (fstat(fd, &st) == -1)
+	if (prog_fstat(fd, &st) == -1)
 		err(1, "stat failure on: %s", dev_name);
 	if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
 		err(1, "invalid device: %s", dev_name);

Reply via email to