Source-Changes-HG archive

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

[src/trunk]: src/sbin/disklabel move dk_ioctl to a header file for the benefi...



details:   https://anonhg.NetBSD.org/src/rev/512d4e6a868b
branches:  trunk
changeset: 784076:512d4e6a868b
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 17 18:33:58 2013 +0000

description:
move dk_ioctl to a header file for the benefit of x-building.

diffstat:

 sbin/disklabel/extern.h   |  14 +++++++++++++-
 sbin/disklabel/interact.c |   6 +++---
 sbin/disklabel/main.c     |  14 ++------------
 3 files changed, 18 insertions(+), 16 deletions(-)

diffs (87 lines):

diff -r 89d5b158ac5c -r 512d4e6a868b sbin/disklabel/extern.h
--- a/sbin/disklabel/extern.h   Thu Jan 17 17:33:16 2013 +0000
+++ b/sbin/disklabel/extern.h   Thu Jan 17 18:33:58 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.11 2009/10/21 01:07:46 snj Exp $  */
+/*     $NetBSD: extern.h,v 1.12 2013/01/17 18:33:58 christos Exp $     */
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -34,3 +34,15 @@
 
 extern char    specname[];
 extern int      Cflag;
+
+#ifdef HAVE_NBTOOL_CONFIG_H
+static int
+dk_ioctl(int f, void *arg)
+{
+       errno = ENOTTY;
+       return -1;
+}
+# define dk_ioctl(f, cmd, arg) dk_ioctl(f, arg)
+#else
+# define dk_ioctl(f, cmd, arg) ioctl(f, cmd, arg)
+#endif /* HAVE_NBTOOL_CONFIG_H */
diff -r 89d5b158ac5c -r 512d4e6a868b sbin/disklabel/interact.c
--- a/sbin/disklabel/interact.c Thu Jan 17 17:33:16 2013 +0000
+++ b/sbin/disklabel/interact.c Thu Jan 17 18:33:58 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interact.c,v 1.36 2013/01/15 23:52:48 christos Exp $   */
+/*     $NetBSD: interact.c,v 1.37 2013/01/17 18:33:58 christos Exp $   */
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: interact.c,v 1.36 2013/01/15 23:52:48 christos Exp $");
+__RCSID("$NetBSD: interact.c,v 1.37 2013/01/17 18:33:58 christos Exp $");
 #endif /* lint */
 
 #include <sys/param.h>
@@ -112,7 +112,7 @@
 {
        struct disklabel dl;
 
-       if (ioctl(fd, DIOCGDEFLABEL, &dl) == -1) {
+       if (dk_ioctl(fd, DIOCGDEFLABEL, &dl) == -1) {
                warn("Cannot get default label");
                return;
        }
diff -r 89d5b158ac5c -r 512d4e6a868b sbin/disklabel/main.c
--- a/sbin/disklabel/main.c     Thu Jan 17 17:33:16 2013 +0000
+++ b/sbin/disklabel/main.c     Thu Jan 17 18:33:58 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.27 2012/04/08 07:59:53 cyber Exp $  */
+/*     $NetBSD: main.c,v 1.28 2013/01/17 18:33:58 christos Exp $       */
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
 static char sccsid[] = "@(#)disklabel.c        8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c        1.2 (Symmetric) 11/28/85"; */
 #else
-__RCSID("$NetBSD: main.c,v 1.27 2012/04/08 07:59:53 cyber Exp $");
+__RCSID("$NetBSD: main.c,v 1.28 2013/01/17 18:33:58 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -214,16 +214,6 @@
        strlcpy(buf, path, buflen);
        return f;
 }
-
-static int
-dk_ioctl(int f, void *arg)
-{
-       errno = ENOTTY;
-       return -1;
-}
-#define dk_ioctl(f, cmd, arg) dk_ioctl(f, arg)
-#else
-#define dk_ioctl(f, cmd, arg) ioctl(f, cmd, arg)
 #endif /* HAVE_NBTOOL_CONFIG_H */
 
 static daddr_t



Home | Main Index | Thread Index | Old Index