Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/raidctl Exterminate a bug I created in 2009.



details:   https://anonhg.NetBSD.org/src/rev/98fb9f0c94d9
branches:  trunk
changeset: 761849:98fb9f0c94d9
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Feb 09 11:22:49 2011 +0000

description:
Exterminate a bug I created in 2009.

diffstat:

 sbin/raidctl/prog_ops.h        |  5 ++++-
 sbin/raidctl/raidctl.c         |  6 +++---
 sbin/raidctl/raidctl_hostops.c |  5 +++--
 sbin/raidctl/raidctl_rumpops.c |  5 +++--
 4 files changed, 13 insertions(+), 8 deletions(-)

diffs (108 lines):

diff -r 7b6bd050ced8 -r 98fb9f0c94d9 sbin/raidctl/prog_ops.h
--- a/sbin/raidctl/prog_ops.h   Wed Feb 09 10:25:40 2011 +0000
+++ b/sbin/raidctl/prog_ops.h   Wed Feb 09 11:22:49 2011 +0000
@@ -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
 
diff -r 7b6bd050ced8 -r 98fb9f0c94d9 sbin/raidctl/raidctl.c
--- a/sbin/raidctl/raidctl.c    Wed Feb 09 10:25:40 2011 +0000
+++ b/sbin/raidctl/raidctl.c    Wed Feb 09 11:22:49 2011 +0000
@@ -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);
diff -r 7b6bd050ced8 -r 98fb9f0c94d9 sbin/raidctl/raidctl_hostops.c
--- a/sbin/raidctl/raidctl_hostops.c    Wed Feb 09 10:25:40 2011 +0000
+++ b/sbin/raidctl/raidctl_hostops.c    Wed Feb 09 11:22:49 2011 +0000
@@ -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,
 };
diff -r 7b6bd050ced8 -r 98fb9f0c94d9 sbin/raidctl/raidctl_rumpops.c
--- a/sbin/raidctl/raidctl_rumpops.c    Wed Feb 09 10:25:40 2011 +0000
+++ b/sbin/raidctl/raidctl_rumpops.c    Wed Feb 09 11:22:49 2011 +0000
@@ -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,
 };



Home | Main Index | Thread Index | Old Index