Module Name:    src
Committed By:   christos
Date:           Thu Jan 17 18:33:58 UTC 2013

Modified Files:
        src/sbin/disklabel: extern.h interact.c main.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sbin/disklabel/extern.h
cvs rdiff -u -r1.36 -r1.37 src/sbin/disklabel/interact.c
cvs rdiff -u -r1.27 -r1.28 src/sbin/disklabel/main.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/disklabel/extern.h
diff -u src/sbin/disklabel/extern.h:1.11 src/sbin/disklabel/extern.h:1.12
--- src/sbin/disklabel/extern.h:1.11	Tue Oct 20 21:07:46 2009
+++ src/sbin/disklabel/extern.h	Thu Jan 17 13:33:58 2013
@@ -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 @@ int	list_fs_types(void);
 
 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 */

Index: src/sbin/disklabel/interact.c
diff -u src/sbin/disklabel/interact.c:1.36 src/sbin/disklabel/interact.c:1.37
--- src/sbin/disklabel/interact.c:1.36	Tue Jan 15 18:52:48 2013
+++ src/sbin/disklabel/interact.c	Thu Jan 17 13:33:58 2013
@@ -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 @@ cmd_adjust(struct disklabel *lp, char *s
 {
 	struct disklabel dl;
 
-	if (ioctl(fd, DIOCGDEFLABEL, &dl) == -1) {
+	if (dk_ioctl(fd, DIOCGDEFLABEL, &dl) == -1) {
 		warn("Cannot get default label");
 		return;
 	}

Index: src/sbin/disklabel/main.c
diff -u src/sbin/disklabel/main.c:1.27 src/sbin/disklabel/main.c:1.28
--- src/sbin/disklabel/main.c:1.27	Sun Apr  8 03:59:53 2012
+++ src/sbin/disklabel/main.c	Thu Jan 17 13:33:58 2013
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 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 @@ opendisk(const char *path, int flags, ch
 	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

Reply via email to