Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src Pull in some fixes from trunk so this compiles on non-N...
details: https://anonhg.NetBSD.org/src/rev/351a1a3b7d9b
branches: netbsd-1-6
changeset: 531402:351a1a3b7d9b
user: jmc <jmc%NetBSD.org@localhost>
date: Wed Jun 16 01:31:38 2004 +0000
description:
Pull in some fixes from trunk so this compiles on non-NetBSD hosts. Found
during fixes for PR#24481
diffstat:
tools/sunlabel/Makefile | 4 ++--
usr.sbin/sunlabel/sunlabel.c | 12 +++++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diffs (66 lines):
diff -r 7211bdca7e19 -r 351a1a3b7d9b tools/sunlabel/Makefile
--- a/tools/sunlabel/Makefile Wed Jun 16 01:27:38 2004 +0000
+++ b/tools/sunlabel/Makefile Wed Jun 16 01:31:38 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2002/01/10 16:35:05 mrg Exp $
+# $NetBSD: Makefile,v 1.1.2.1 2004/06/16 01:31:38 jmc Exp $
HOSTPROGNAME= nbsunlabel
HOST_SRCDIR= usr.sbin/sunlabel
-HOST_CPPFLAGS= -DDISTRIB
+HOST_CPPFLAGS= -DDISTRIB -DNO_S_COMMAND -DNO_TERMCAP_WIDTH
.include "${.CURDIR}/../Makefile.host"
diff -r 7211bdca7e19 -r 351a1a3b7d9b usr.sbin/sunlabel/sunlabel.c
--- a/usr.sbin/sunlabel/sunlabel.c Wed Jun 16 01:27:38 2004 +0000
+++ b/usr.sbin/sunlabel/sunlabel.c Wed Jun 16 01:31:38 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunlabel.c,v 1.5.2.3 2002/12/26 07:45:24 tron Exp $ */
+/* $NetBSD: sunlabel.c,v 1.5.2.4 2004/06/16 01:31:38 jmc Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -36,8 +36,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/cdefs.h>
-__RCSID("$NetBSD: sunlabel.c,v 1.5.2.3 2002/12/26 07:45:24 tron Exp $");
+__RCSID("$NetBSD: sunlabel.c,v 1.5.2.4 2004/06/16 01:31:38 jmc Exp $");
#include <stdio.h>
#include <errno.h>
@@ -51,12 +55,12 @@
#include <sys/file.h>
#include <sys/ioctl.h>
-#include <sys/disklabel.h>
/* If neither S_COMMAND nor NO_S_COMMAND is defined, guess. */
#if !defined(S_COMMAND) && !defined(NO_S_COMMAND)
#define S_COMMAND
#include <util.h>
+#include <sys/disklabel.h>
#endif
/*
@@ -263,6 +267,7 @@
}
if (trydisk(s, 0))
return;
+#ifndef DISTRIB /* native tool: search in /dev */
tmp = malloc(strlen(s) + 7);
sprintf(tmp, "/dev/%s", s);
if (trydisk(tmp, 0))
@@ -270,6 +275,7 @@
sprintf(tmp, "/dev/%s%c", s, getrawpartition() + 'a');
if (trydisk(tmp, 0))
return;
+#endif
errx(1, "Can't find device for disk `%s'", s);
}
Home |
Main Index |
Thread Index |
Old Index