CVS commit: src/sbin/fsck

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr  8 04:19:14 UTC 2012

Modified Files:
src/sbin/fsck: fsutil.c

Log Message:
Don't re-use the same buffer that we pass in for newname in the cooked->raw
conversion. Better variable names.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck/fsutil.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/fsck/fsutil.c
diff -u src/sbin/fsck/fsutil.c:1.22 src/sbin/fsck/fsutil.c:1.23
--- src/sbin/fsck/fsutil.c:1.22	Sat Apr  7 12:44:10 2012
+++ src/sbin/fsck/fsutil.c	Sun Apr  8 00:19:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsutil.c,v 1.22 2012/04/07 16:44:10 christos Exp $	*/
+/*	$NetBSD: fsutil.c,v 1.23 2012/04/08 04:19:14 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fsutil.c,v 1.22 2012/04/07 16:44:10 christos Exp $");
+__RCSID("$NetBSD: fsutil.c,v 1.23 2012/04/08 04:19:14 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -170,9 +170,10 @@ const char *
 blockcheck(const char *origname)
 {
 	struct stat stslash, stblock, stchar;
-	const char *newname, *raw;
+	const char *newname, *raw, *cooked;
 	struct fstab *fsp;
 	int retried = 0;
+	char cbuf[MAXPATHLEN];
 	static char buf[MAXPATHLEN];
 
 	hot = 0;
@@ -184,7 +185,7 @@ blockcheck(const char *origname)
 retry:
 	if (stat(newname, &stblock) < 0) {
 		perr("Can't stat `%s'", newname);
-		return (origname);
+		return origname;
 	}
 	if (S_ISBLK(stblock.st_mode)) {
 		if (stslash.st_dev == stblock.st_rdev)
@@ -196,26 +197,25 @@ retry:
 		}
 		if (stat(raw, &stchar) < 0) {
 			perr("Can't stat `%s'", raw);
-			return (origname);
+			return origname;
 		}
 		if (S_ISCHR(stchar.st_mode)) {
-			return (raw);
+			return raw;
 		} else {
-			printf("%s is not a character device\n", raw);
-			return (origname);
+			perr("%s is not a character device\n", raw);
+			return origname;
 		}
 	} else if (S_ISCHR(stblock.st_mode) && !retried) {
-		raw = getdiskcookedname(buf, sizeof(buf), newname);
-		if (raw == NULL) {
+		cooked = getdiskcookedname(cbuf, sizeof(cbuf), newname);
+		if (cooked == NULL) {
 			perr("Can't convert to cooked `%s'", newname);
 			return origname;
 		} else
-			newname = raw;
+			newname = cooked;
 		retried++;
 		goto retry;
 	} else if ((fsp = getfsfile(newname)) != 0 && !retried) {
-		char rbuf[MAXPATHLEN];
-		newname = getfsspecname(rbuf, sizeof(rbuf), fsp->fs_spec);
+		newname = getfsspecname(cbuf, sizeof(cbuf), fsp->fs_spec);
 		if (newname == NULL)
 			perr("%s", buf);
 		retried++;
@@ -225,7 +225,7 @@ retry:
 	 * Not a block or character device, just return name and
 	 * let the user decide whether to use it.
 	 */
-	return (origname);
+	return origname;
 }
 
 const char *



CVS commit: src/distrib/utils/sysinst

2012-04-07 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Apr  8 03:11:14 UTC 2012

Modified Files:
src/distrib/utils/sysinst: msg.mi.fr

Log Message:
Remove duplicate English text.  Remove ^M.  Fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/distrib/utils/sysinst/msg.mi.fr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/msg.mi.fr
diff -u src/distrib/utils/sysinst/msg.mi.fr:1.125 src/distrib/utils/sysinst/msg.mi.fr:1.126
--- src/distrib/utils/sysinst/msg.mi.fr:1.125	Sat Apr  7 23:25:18 2012
+++ src/distrib/utils/sysinst/msg.mi.fr	Sun Apr  8 03:11:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.125 2012/04/07 23:25:18 riz Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.126 2012/04/08 03:11:14 uebayasi Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -43,14 +43,14 @@ message usage
  * before the locale is set up!
  */
 message sysinst_message_language
-{Messages d'installation en français}
+{Messages d'installation en français}
 
 message sysinst_message_locale
 {fr_FR.ISO8859-15}
 
 message Yes {Oui}
 message No {Non}
-message All {Tous}
+message All {Tous}
 message Some {Une partie}
 message None {Aucun}
 message none {aucun}
@@ -74,10 +74,10 @@ message hello
 {Bienvenue dans Sysinst, l'outil d'installation de NetBSD-@@VERSION@@.
 Cet utilitaire a été conçu pour vous aider à installer ou mettre à jour
 NetBSD sur votre disque dur avec un minimum de travail.
-Dans les menus suivants, vous pourrez changer de sélection, soit en tapant la
-lettre en référence (a, b, c, d, ...) soit en utilisant les touches
+Dans les menus suivants, vous pourrez changer de sélection, soit en tapant la
+lettre en référence (a, b, c, d, ...) soit en utilisant les touches
 flèches du clavier.
-La sélection courante est activée en appuyant sur la touche Entrée.
+La sélection courante est activée en appuyant sur la touche Entrée.
 }
 
 message thanks
@@ -88,26 +88,26 @@ message installusure
 {Vous avez choisi d'installer NetBSD sur votre disque dur. Ceci va changer les
 informations contenues sur ce dernier. Vous devriez faire une sauvegarde
 complète de son contenu avant de poursuivre cette installation. Cette
-procédure va effectuer les actions suivantes :
+procédure va effectuer les actions suivantes :
 	a) Partitionner votre disque dur.
 	b) Créer de nouveaux systèmes de fichiers BSD.
 	c) Installer les différents composants.
 
 (Une fois le partitionnement configuré, le système d'installation vous
-demandera de confirmer avant d'appliquer toute modification sur votre
-disque dur.
+demandera de confirmer avant d'appliquer toute modification sur votre
+disque dur.
 Souhaitez-vous continuer ?
 }
 
 message upgradeusure
-{Mise à jour de NetBSD sur votre disque dur.
-Cela implique des modifications aux informations contenues
+{Mise à jour de NetBSD sur votre disque dur.
+Cela implique des modifications aux informations contenues
 sur votre disque dur.
 Vous devriez faire une sauvegarde complète de celui-ci avant de
 continuer la procédure de mise à jour.
 Voulez-vous vraiment mettre à jour NetBSD ?
 (Ceci est le dernier avertissement avant que cette
-procédure ne modifie votre disque).
+procédure ne modifie votre disque).
 }
 
 message reinstallusure
@@ -124,16 +124,16 @@ ou une mise à jour avant de démarrer cet
 
 Voulez-vous réellement réinstaller les composants NetBSD ?
 (Ceci est le dernier avertissement avant que cette procédure ne commence à
-modifier vos disques).
+modifier vos disques).
 }
 
 message nodisk
-{Aucun disque utilisable par NetBSD n'a été trouvé.
-Retour au menu précédent.
+{Aucun disque utilisable par NetBSD n'a été trouvé.
+Retour au menu précédent.
 }
 
 message onedisk
-{Un seul disque a été trouvé : %s. Nous supposons que vous souhaitez
+{Un seul disque a été trouvé : %s. Nous supposons que vous souhaitez
 %s NetBSD sur ce dernier.
 }
 
@@ -166,10 +166,10 @@ message megname
 
 message layout
 {NetBSD utilise un "disklabel" BSD pour diviser la portion du disque réservée à
-NetBSD en plusieurs partitions. Vous devez paramétrer ce dernier.
+NetBSD en plusieurs partitions. Vous devez paramétrer ce dernier.
 
-Vous pouvez utiliser un éditeur afin de préciser la taille des partitions
-NetBSD, ou préserver la taille et le contenu des partitions existantes.
+Vous pouvez utiliser un éditeur afin de préciser la taille des partitions
+NetBSD, ou préserver la taille et le contenu des partitions existantes.
 
 Vous aurez ensuite la possibilité d'éditer les champs du disklabel.
 
@@ -179,26 +179,26 @@ L'installation standard avec X requiert 
 }
 
 message Choose_your_size_specifier
-{Si vous choisissez "Mégaoctets", la taille sera le plus proche de votre
-choix possible, arrondi au cylindre-près.
-Si vous choisissez "Secteurs", vous pourrez choisir précisément
+{Si vous choisissez "Mégaoctets", la taille sera le plus proche de votre
+choix possible

CVS commit: src/distrib/utils/sysinst

2012-04-07 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr  7 23:25:18 UTC 2012

Modified Files:
src/distrib/utils/sysinst: msg.mi.fr

Log Message:
French translation of new strings, and some other fixes.
>From Matthew Mondor.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/distrib/utils/sysinst/msg.mi.fr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/msg.mi.fr
diff -u src/distrib/utils/sysinst/msg.mi.fr:1.124 src/distrib/utils/sysinst/msg.mi.fr:1.125
--- src/distrib/utils/sysinst/msg.mi.fr:1.124	Fri Apr  6 23:48:53 2012
+++ src/distrib/utils/sysinst/msg.mi.fr	Sat Apr  7 23:25:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.124 2012/04/06 23:48:53 riz Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.125 2012/04/07 23:25:18 riz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -43,14 +43,14 @@ message usage
  * before the locale is set up!
  */
 message sysinst_message_language
-{Messages d'installation en francais}
+{Messages d'installation en français}
 
 message sysinst_message_locale
 {fr_FR.ISO8859-15}
 
 message Yes {Oui}
 message No {Non}
-message All {Tout}
+message All {Tous}
 message Some {Une partie}
 message None {Aucun}
 message none {aucun}
@@ -74,10 +74,10 @@ message hello
 {Bienvenue dans Sysinst, l'outil d'installation de NetBSD-@@VERSION@@.
 Cet utilitaire a été conçu pour vous aider à installer ou mettre à jour
 NetBSD sur votre disque dur avec un minimum de travail.
-Dans les menus suivants, vous pourrez changer de sélection soit en tapant la
-lettre en référence (a, b, c, d,...) soit en utilisant les touches
+Dans les menus suivants, vous pourrez changer de sélection, soit en tapant la
+lettre en référence (a, b, c, d, ...) soit en utilisant les touches
 flèches du clavier.
-La sélection courante est activée en appuyant sur entrée.
+La sélection courante est activée en appuyant sur la touche Entrée.
 }
 
 message thanks
@@ -88,25 +88,26 @@ message installusure
 {Vous avez choisi d'installer NetBSD sur votre disque dur. Ceci va changer les
 informations contenues sur ce dernier. Vous devriez faire une sauvegarde
 complète de son contenu avant de poursuivre cette installation. Cette
-procédure va mener les actions suivantes :
+procédure va effectuer les actions suivantes :
 	a) Partitionner votre disque dur.
 	b) Créer de nouveaux systèmes de fichiers BSD.
 	c) Installer les différents composants.
 
 (Une fois le partitionnement configuré, le système d'installation vous
-demandera de confirmer avant de modifier votre disque dur.
+demandera de confirmer avant d'appliquer toute modification sur votre
+disque dur.
 Souhaitez-vous continuer ?
 }
 
 message upgradeusure
-{Mettons maintenant à jour NetBSD sur votre disque dur.
-Comme d'habitude, cela va changer les informations contenues
+{Mise à jour de NetBSD sur votre disque dur.
+Cela implique des modifications aux informations contenues
 sur votre disque dur.
 Vous devriez faire une sauvegarde complète de celui-ci avant de
 continuer la procédure de mise à jour.
 Voulez-vous vraiment mettre à jour NetBSD ?
 (Ceci est le dernier avertissement avant que cette
-procédure ne modifie votre disque.)
+procédure ne modifie votre disque).
 }
 
 message reinstallusure
@@ -123,16 +124,16 @@ ou une mise à jour avant de démarrer cet
 
 Voulez-vous réellement réinstaller les composants NetBSD ?
 (Ceci est le dernier avertissement avant que cette procédure ne commence à
-modifier vos disques.)
+modifier vos disques).
 }
 
 message nodisk
-{Nous ne trouvons aucun disque utilisable par NetBSD. Vous allez retourner
-au menu précédent.
+{Aucun disque utilisable par NetBSD n'a été trouvé.
+Retour au menu précédent.
 }
 
 message onedisk
-{Nous ne trouvons qu'un seul disque : %s. Nous supposons que vous souhaitez
+{Un seul disque a été trouvé : %s. Nous supposons que vous souhaitez
 %s NetBSD sur ce dernier.
 }
 
@@ -165,10 +166,10 @@ message megname
 
 message layout
 {NetBSD utilise un "disklabel" BSD pour diviser la portion du disque réservée à
-NetBSD en de multiples partitions. Vous devez paramétrer ce dernier.
+NetBSD en plusieurs partitions. Vous devez paramétrer ce dernier.
 
-Vous pouvez utiliser un éditeur pour préciser la taille des partitions NetBSD,
-ou garder la taille et le contenu des partitions existantes.
+Vous pouvez utiliser un éditeur afin de préciser la taille des partitions
+NetBSD, ou préserver la taille et le contenu des partitions existantes.
 
 Vous aurez ensuite la possibilité d'éditer les champs du disklabel.
 
@@ -178,26 +179,26 @@ L'installation standard avec X requiert 
 }
 
 message Choose_your_size_specifier
-{Si vous choisissez par "Mégaoctets", la taille sera proche de votre
-choix tout en conservant un nombre entier de cylindres.
-Si vous choisissez par "Secteurs", vous pourrez choisir précisément
+{Si vous choisissez "Mégaoctets", la taille sera le plus proche de 

CVS commit: src/distrib/utils/sysinst

2012-04-07 Thread Julian Fagir
Module Name:src
Committed By:   jdf
Date:   Sat Apr  7 19:02:57 UTC 2012

Modified Files:
src/distrib/utils/sysinst: menus.mi util.c

Log Message:
Fix for PR 45816: Restructuring the error menu when the CD ROM is missing.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/utils/sysinst/menus.mi
cvs rdiff -u -r1.175 -r1.176 src/distrib/utils/sysinst/util.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/menus.mi
diff -u src/distrib/utils/sysinst/menus.mi:1.45 src/distrib/utils/sysinst/menus.mi:1.46
--- src/distrib/utils/sysinst/menus.mi:1.45	Fri Apr  6 23:48:53 2012
+++ src/distrib/utils/sysinst/menus.mi	Sat Apr  7 19:02:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: menus.mi,v 1.45 2012/04/06 23:48:53 riz Exp $	*/
+/*	$NetBSD: menus.mi,v 1.46 2012/04/07 19:02:57 jdf Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -325,7 +325,7 @@ menu floppysource, y=-4, x=0, w=70, no b
 			clean_xfer_dir = yesno; };
 
 menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
-	display action { msg_display_add(MSG_cdromsource); };
+	display action { msg_display(MSG_cdromsource); };
 	option {src_legend(menu, MSG_Device, cdrom_dev);},
 		action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); };
 	option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);},

Index: src/distrib/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.175 src/distrib/utils/sysinst/util.c:1.176
--- src/distrib/utils/sysinst/util.c:1.175	Fri Apr  6 23:48:54 2012
+++ src/distrib/utils/sysinst/util.c	Sat Apr  7 19:02:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.175 2012/04/06 23:48:54 riz Exp $	*/
+/*	$NetBSD: util.c,v 1.176 2012/04/07 19:02:57 jdf Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -572,7 +572,7 @@ get_via_cdrom(void)
 	else {
 		umount_mnt2();
 		msg_display(MSG_cd_path_not_found);
-		msg_display_add("\r\n\r\n");
+		process_menu(MENU_ok, NULL);
 	}
 
 	/* ask for paths on the CD */



CVS commit: src/usr.bin/make

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 18:29:08 UTC 2012

Modified Files:
src/usr.bin/make: dir.c dir.h job.c make.c

Log Message:
Remove recheck hackery that caused extra stats, and explicitly ask for
recheck when needed. Before it used to be the case that we could only
use the cached entry once. Once the cached entry was used, we removed
it from the cache. Now it is kept forever.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/make/dir.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/dir.h
cvs rdiff -u -r1.160 -r1.161 src/usr.bin/make/job.c
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/make.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.63 src/usr.bin/make/dir.c:1.64
--- src/usr.bin/make/dir.c:1.63	Sat Mar  5 18:57:05 2011
+++ src/usr.bin/make/dir.c	Sat Apr  7 14:29:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $	*/
+/*	$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.63 2011/03/05 23:57:05 sjg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1428,7 +1428,7 @@ Dir_FindHereOrAbove(char *here, char *se
  *---
  */
 int
-Dir_MTime(GNode *gn)
+Dir_MTime(GNode *gn, Boolean recheck)
 {
 char  *fullName;  /* the full pathname of name */
 struct stat	  stb;	  /* buffer for finding the mod time */
@@ -1481,19 +1481,16 @@ Dir_MTime(GNode *gn)
 	fullName = bmake_strdup(gn->name);
 }
 
-entry = Hash_FindEntry(&mtimes, fullName);
+if (!recheck)
+	entry = Hash_FindEntry(&mtimes, fullName);
+else
+	entry = NULL;
 if (entry != NULL) {
-	/*
-	 * Only do this once -- the second time folks are checking to
-	 * see if the file was actually updated, so we need to actually go
-	 * to the file system.
-	 */
 	if (DEBUG(DIR)) {
 	fprintf(debug_file, "Using cached time %s for %s\n",
 		Targ_FmtTime(Hash_GetTimeValue(entry)), fullName);
 	}
 	stb.st_mtime = Hash_GetTimeValue(entry);
-	Hash_DeleteEntry(&mtimes, entry);
 } else if (stat(fullName, &stb) < 0) {
 	if (gn->type & OP_MEMBER) {
 	if (fullName != gn->path)
@@ -1502,12 +1499,16 @@ Dir_MTime(GNode *gn)
 	} else {
 	stb.st_mtime = 0;
 	}
-} else if (stb.st_mtime == 0) {
-	/*
-	 * 0 handled specially by the code, if the time is really 0, return
-	 * something else instead
-	 */
-	stb.st_mtime = 1;
+} else {
+	if (stb.st_mtime == 0) {
+		/*
+		 * 0 handled specially by the code, if the time is really 0,
+		 * return something else instead
+		 */
+		stb.st_mtime = 1;
+	}
+	entry = Hash_CreateEntry(&mtimes, fullName, NULL);
+	Hash_SetTimeValue(entry, stb.st_mtime);
 }
 	
 if (fullName && gn->path == NULL) {

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.14 src/usr.bin/make/dir.h:1.15
--- src/usr.bin/make/dir.h:1.14	Fri Jan 23 16:26:30 2009
+++ src/usr.bin/make/dir.h	Sat Apr  7 14:29:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.14 2009/01/23 21:26:30 dsl Exp $	*/
+/*	$NetBSD: dir.h,v 1.15 2012/04/07 18:29:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -95,7 +95,7 @@ Boolean Dir_HasWildcards(char *);
 void Dir_Expand(const char *, Lst, Lst);
 char *Dir_FindFile(const char *, Lst);
 int Dir_FindHereOrAbove(char *, char *, char *, int);
-int Dir_MTime(GNode *);
+int Dir_MTime(GNode *, Boolean);
 Path *Dir_AddDir(Lst, const char *);
 char *Dir_MakeFlags(const char *, Lst);
 void Dir_ClearPath(Lst);

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.160 src/usr.bin/make/job.c:1.161
--- src/usr.bin/make/job.c:1.160	Fri Sep 16 11:38:03 2011
+++ src/usr.bin/make/job.c	Sat Apr  7 14:29:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.160 2011/09/16 15:38:03 joerg Exp $	*/
+/*	$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.160 2011/09/16 15:38:03 joerg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.160 2011/09/16 15:38:03 joerg Exp $");
+__RCSID("$Net

CVS commit: src/external/bsd/file/dist

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:30:56 UTC 2012

Modified Files:
src/external/bsd/file/dist/magic/magdir: apple
src/external/bsd/file/dist/src: apprentice.c softmagic.c

Log Message:
bring in changes from head.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/file/dist/magic/magdir/apple
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/file/dist/src/apprentice.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/file/dist/src/softmagic.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/file/dist/magic/magdir/apple
diff -u src/external/bsd/file/dist/magic/magdir/apple:1.1.1.2 src/external/bsd/file/dist/magic/magdir/apple:1.2
--- src/external/bsd/file/dist/magic/magdir/apple:1.1.1.2	Thu May 12 16:46:57 2011
+++ src/external/bsd/file/dist/magic/magdir/apple	Sat Apr  7 13:30:55 2012
@@ -1,6 +1,6 @@
 
 #--
-# $File: apple,v 1.24 2010/11/25 15:00:12 christos Exp $
+# $File: apple,v 1.25 2012/04/06 21:18:09 christos Exp $
 # apple:  file(1) magic for Apple file formats
 #
 0	search/1/t	FiLeStArTfIlEsTaRt	binscii (apple ][) text
@@ -249,3 +249,45 @@
 # From: "Nelson A. de Oliveira" 
 # .vdi
 4	string innotek\ VirtualBox\ Disk\ Image %s
+
+# Apple disk partition stuff, strengthen the magic using byte 4
+0	beshort	0x4552
+>4	byte	0			Apple Driver Map
+>>2	beshort	x			\b, blocksize %d
+>>4	belong	x			\b, blockcount %d
+>>10	beshort	x			\b, devtype %d
+>>12	beshort	x			\b, devid %d
+>>20	beshort x			\b, descriptors %d
+# Assume 	8 partitions each at a multiple of the sector size.
+# We could glean this from the partition descriptors, but they are empty!?!?
+>>(2.S*1)	indirect		\b, contains[@0x%x]: 
+>>(2.S*2)	indirect		\b, contains[@0x%x]: 
+>>(2.S*3)	indirect		\b, contains[@0x%x]: 
+>>(2.S*4)	indirect		\b, contains[@0x%x]: 
+>>(2.S*5)	indirect		\b, contains[@0x%x]: 
+>>(2.S*6)	indirect		\b, contains[@0x%x]: 
+>>(2.S*7)	indirect		\b, contains[@0x%x]: 
+>>(2.S*8)	indirect		\b, contains[@0x%x]: 
+
+# Yes, the 3rd and 4th bytes are reserved, but we use them to make the
+# magic stronger.
+0	belong	0x504d		Apple Partition Map
+>4	belong	x			\b, map block count %d
+>8	belong	x			\b, start block %d
+>12	belong	x			\b, block count %d
+>16	string >0			\b, name %s
+>48	string >0			\b, type %s
+>124	string >0			\b, processor %s
+>140	string >0			\b, boot arguments %s
+>92	belong	& 1			\b, valid
+>92	belong	& 2			\b, allocated
+>92	belong	& 4			\b, in use
+>92	belong	& 8			\b, has boot info
+>92	belong	& 16			\b, readable
+>92	belong	& 32			\b, writable
+>92	belong	& 64			\b, pic boot code
+>92	belong	& 128			\b, chain compatible driver
+>92	belong	& 256			\b, real driver
+>92	belong	& 512			\b, chain driver
+>92	belong	& 1024			\b, mount at startup
+>92	belong	& 2048			\b, is the startup partition

Index: src/external/bsd/file/dist/src/apprentice.c
diff -u src/external/bsd/file/dist/src/apprentice.c:1.6 src/external/bsd/file/dist/src/apprentice.c:1.7
--- src/external/bsd/file/dist/src/apprentice.c:1.6	Wed Feb 22 12:53:51 2012
+++ src/external/bsd/file/dist/src/apprentice.c	Sat Apr  7 13:30:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: apprentice.c,v 1.6 2012/02/22 17:53:51 christos Exp $	*/
+/*	$NetBSD: apprentice.c,v 1.7 2012/04/07 17:30:55 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: apprentice.c,v 1.173 2011/12/08 12:38:24 rrt Exp $")
 #else
-__RCSID("$NetBSD: apprentice.c,v 1.6 2012/02/22 17:53:51 christos Exp $");
+__RCSID("$NetBSD: apprentice.c,v 1.7 2012/04/07 17:30:55 christos Exp $");
 #endif
 #endif	/* lint */
 
@@ -218,7 +218,7 @@ static const struct type_tbl_s {
 	{ XX("ledouble"),	FILE_LEDOUBLE,		FILE_FMT_DOUBLE },
 	{ XX("leid3"),		FILE_LEID3,		FILE_FMT_NUM },
 	{ XX("beid3"),		FILE_BEID3,		FILE_FMT_NUM },
-	{ XX("indirect"),	FILE_INDIRECT,		FILE_FMT_NONE },
+	{ XX("indirect"),	FILE_INDIRECT,		FILE_FMT_NUM },
 	{ XX_NULL,		FILE_INVALID,		FILE_FMT_NONE },
 # undef XX
 # undef XX_NULL
@@ -477,6 +477,9 @@ apprentice_magic_strength(const struct m
 		val += 8 * MULT;
 		break;
 
+	case FILE_INDIRECT:
+		break;
+
 	default:
 		val = 0;
 		(void)fprintf(stderr, "Bad type %d\n", m->type);

Index: src/external/bsd/file/dist/src/softmagic.c
diff -u src/external/bsd/file/dist/src/softmagic.c:1.5 src/external/bsd/file/dist/src/softmagic.c:1.6
--- src/external/bsd/file/dist/src/softmagic.c:1.5	Wed Feb 22 12:53:51 2012
+++ src/external/bsd/file/dist/src/softmagic.c	Sat Apr  7 13:30:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: softmagic.c,v 1.5 2012/02/22 17:53:51 christos Exp $	*/
+/*	$NetBSD: softmagic.c,v 1.6 2012/04/07 17:30:56 christos Exp $	*/
 
 /*
  * Copyright (c) Ian F. Darwin 1986-1995.
@@ -37,7 +37,7 @@
 #if 0
 FILE_RCSID("@(#)$File: softmagic.c,v 1.147 2011/11/05 15:44:22 rrt Exp $")
 #else
-__RCSID("$NetBS

CVS commit: src/etc

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:28:44 UTC 2012

Modified Files:
src/etc: rc.subr

Log Message:
back out change that makes onestart work, to be committed at some other time.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/etc/rc.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.90 src/etc/rc.subr:1.91
--- src/etc/rc.subr:1.90	Sat Apr  7 13:22:10 2012
+++ src/etc/rc.subr	Sat Apr  7 13:28:44 2012
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.90 2012/04/07 17:22:10 christos Exp $
+# $NetBSD: rc.subr,v 1.91 2012/04/07 17:28:44 christos Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,9 +47,6 @@ nl='
 #
 checkyesno()
 {
-	case $_rc_prefix in
-	one)	eval \$${1}=YES; return 0;;
-	esac
 	eval _value=\$${1}
 	case $_value in
 



CVS commit: src/sys/dev/pci

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:26:16 UTC 2012

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
more broadcom stuff


To generate a diff of this commit:
cvs rdiff -u -r1.1109 -r1.1110 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1109 src/sys/dev/pci/pcidevs:1.1110
--- src/sys/dev/pci/pcidevs:1.1109	Wed Apr  4 18:58:56 2012
+++ src/sys/dev/pci/pcidevs	Sat Apr  7 13:26:16 2012
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1109 2012/04/04 22:58:56 uwe Exp $
+$NetBSD: pcidevs,v 1.1110 2012/04/07 17:26:16 christos Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1617,10 +1617,10 @@ product BROADCOM BCM5906	0x1712	BCM5906 
 product BROADCOM BCM5906M	0x1713	BCM5906M NetLink Fast Ethernet
 product BROADCOM BCM4303	0x4301	BCM4303
 product BROADCOM BCM4307	0x4307	BCM4307
-product BROADCOM BCM4311	0x4311	BCM4311
-product BROADCOM BCM4312	0x4312	BCM4312
-product BROADCOM BCM4313	0x4313	BCM4313
-product BROADCOM BCM4315	0x4315	BCM4315
+product BROADCOM BCM4311	0x4311	BCM4311 2.4GHz
+product BROADCOM BCM4312	0x4312	BCM4312 Dualband
+product BROADCOM BCM4313	0x4313	BCM4313 5GHz
+product BROADCOM BCM4315	0x4315	BCM4315 2.4GHz
 product BROADCOM BCM4318	0x4318	BCM4318 AirForce One 54g
 product BROADCOM BCM4319	0x4319	BCM4319
 product BROADCOM BCM4306	0x4320	BCM4306
@@ -1634,6 +1634,10 @@ product BROADCOM BCM432A	0x432a	BCM432A 
 product BROADCOM BCM432B	0x432b	BCM432B 802.11a/b/g/n
 product BROADCOM BCM432C	0x432c	BCM432C 802.11b/g/n
 product BROADCOM BCM432D	0x432d	BCM432D 802.11
+product BROADCOM BCM43224	0x4353	BCM43224 Dualband 802.11
+product BROADCOM BCM43225	0x4357	BCM43225 2.4GHz 802.11
+product BROADCOM BCM43227	0x4358	BCM43227 2.4GHz 802.11
+product BROADCOM BCM43228	0x4359	BCM43228 Dualband 802.11
 product BROADCOM BCM4401	0x4401	BCM4401 10/100 Ethernet
 product BROADCOM 5801		0x5801	5801 Security Processor
 product BROADCOM 5802		0x5802	5802 Security Processor



CVS commit: src/etc

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:22:10 UTC 2012

Modified Files:
src/etc: MAKEDEV.tmpl rc.subr
src/etc/etc.amd64: MAKEDEV.conf
src/etc/etc.i386: MAKEDEV.conf

Log Message:
give wedges to everyone


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.89 -r1.90 src/etc/rc.subr
cvs rdiff -u -r1.17 -r1.18 src/etc/etc.amd64/MAKEDEV.conf
cvs rdiff -u -r1.21 -r1.22 src/etc/etc.i386/MAKEDEV.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.153 src/etc/MAKEDEV.tmpl:1.154
--- src/etc/MAKEDEV.tmpl:1.153	Sat Feb 25 05:55:27 2012
+++ src/etc/MAKEDEV.tmpl	Sat Apr  7 13:22:10 2012
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.153 2012/02/25 10:55:27 shattered Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.154 2012/04/07 17:22:10 christos Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -57,6 +57,7 @@
 #	uu*	TU58 cassettes on DL11 controller
 #
 # Disks:
+#	dk*	wedge disk slices
 #	ccd*	concatenated disk devices
 #	cd*	SCSI or ATAPI CD-ROM
 #	cgd*	cryptographic disk devices
@@ -803,6 +804,8 @@ case $i in
 all)
 	makedev all_md
 	makedev std fd ptm pty0 pty1 pty2 pty3
+	makedev dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
+	makedev dk8 dk9 dk10 dk11 dk12 dk13 dk14 dk15
 	makedev ccd0 ccd1 ccd2 ccd3
 	makedev cgd0 cgd1 cgd2 cgd3
 	makedev fss0 fss1 fss2 fss3

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.89 src/etc/rc.subr:1.90
--- src/etc/rc.subr:1.89	Sat Apr  7 12:39:32 2012
+++ src/etc/rc.subr	Sat Apr  7 13:22:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.89 2012/04/07 16:39:32 apb Exp $
+# $NetBSD: rc.subr,v 1.90 2012/04/07 17:22:10 christos Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,6 +47,9 @@ nl='
 #
 checkyesno()
 {
+	case $_rc_prefix in
+	one)	eval \$${1}=YES; return 0;;
+	esac
 	eval _value=\$${1}
 	case $_value in
 

Index: src/etc/etc.amd64/MAKEDEV.conf
diff -u src/etc/etc.amd64/MAKEDEV.conf:1.17 src/etc/etc.amd64/MAKEDEV.conf:1.18
--- src/etc/etc.amd64/MAKEDEV.conf:1.17	Sat Feb 26 13:07:16 2011
+++ src/etc/etc.amd64/MAKEDEV.conf	Sat Apr  7 13:22:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.17 2011/02/26 18:07:16 ahoka Exp $
+# $NetBSD: MAKEDEV.conf,v 1.18 2012/04/07 17:22:10 christos Exp $
 
 # As of 2003-04-17, the "init" case must not create more than 890 entries.
 all_md)
@@ -40,7 +40,6 @@ all_md)
 	makedev kttcp
 	makedev nsmb
 	makedev bio
-	makedev dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
 	;;
 
 xen)

Index: src/etc/etc.i386/MAKEDEV.conf
diff -u src/etc/etc.i386/MAKEDEV.conf:1.21 src/etc/etc.i386/MAKEDEV.conf:1.22
--- src/etc/etc.i386/MAKEDEV.conf:1.21	Sat Feb 26 13:07:17 2011
+++ src/etc/etc.i386/MAKEDEV.conf	Sat Apr  7 13:22:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.21 2011/02/26 18:07:17 ahoka Exp $
+# $NetBSD: MAKEDEV.conf,v 1.22 2012/04/07 17:22:10 christos Exp $
 
 # As of 2005-03-15, the "init" case must not create more than 1024 entries.
 all_md)
@@ -44,7 +44,6 @@ all_md)
 	makedev io
 	makedev bio
 	makedev cfs
-	makedev dk0 dk1 dk2 dk3 dk4 dk5 dk6 dk7
 	;;
 
 xen)



CVS commit: src/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 17:10:03 UTC 2012

Modified Files:
src/lib/libutil: getfsspecname.c

Log Message:
Add and enable COMPAT_DKWEDGE which let's us autoconfigure wedges and boot
with a non-wedge aware fstab.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libutil/getfsspecname.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/getfsspecname.c
diff -u src/lib/libutil/getfsspecname.c:1.1 src/lib/libutil/getfsspecname.c:1.2
--- src/lib/libutil/getfsspecname.c:1.1	Sat Apr  7 00:04:45 2012
+++ src/lib/libutil/getfsspecname.c	Sat Apr  7 13:10:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getfsspecname.c,v 1.1 2012/04/07 04:04:45 christos Exp $	*/
+/*	$NetBSD: getfsspecname.c,v 1.2 2012/04/07 17:10:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: getfsspecname.c,v 1.1 2012/04/07 04:04:45 christos Exp $");
+__RCSID("$NetBSD: getfsspecname.c,v 1.2 2012/04/07 17:10:02 christos Exp $");
 
 #include 
 #include 
@@ -45,6 +45,8 @@ __RCSID("$NetBSD: getfsspecname.c,v 1.1 
 #include 
 #include 
 
+#define COMPAT_DKWEDGE	/* To be removed */
+
 const char *
 getfsspecname(char *buf, size_t bufsiz, const char *name)
 {
@@ -58,11 +60,35 @@ getfsspecname(char *buf, size_t bufsiz, 
 	drives = NULL;
 	vname = NULL;
 	if (strncasecmp(name, "NAME=", 5) != 0) {
+#ifdef COMPAT_DKWEDGE
+		/*
+		 * We try to open the disk name, and if we fail with EBUSY
+		 * we use the name as the label to find the wedge.
+		 */
+		char rbuf[MAXPATHLEN];
+		if (name[0] == '/') {
+			if (getdiskrawname(rbuf, sizeof(rbuf), name) == NULL) {
+savee = errno;
+strlcpy(buf, "makeraw failed", bufsiz);
+goto out;
+			}
+			if ((fd = open(rbuf, O_RDONLY)) == -1) {
+if (errno == EBUSY) {
+	name = strrchr(name, '/') + 1;
+	goto search;
+}
+			} else
+close(fd);
+		}
+#endif
 		strlcpy(buf, name, bufsiz);
 		return buf;
-	}
+	} else
+		name += 5;
 
-	name += 5;
+#ifdef COMPAT_DKWEDGE
+search:
+#endif
 	vname = malloc(strlen(name) * 4 + 1);
 	if (vname == NULL) {
 		savee = errno;



CVS commit: src/distrib/sets/lists

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:48:26 UTC 2012

Modified Files:
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi
src/distrib/sets/lists/comp: ad.mips64eb ad.mips64el md.amd64
md.sparc64 mi shl.mi

Log Message:
- add getdisk{raw,cooked}name
- bump libutil


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.87 -r1.88 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.163 -r1.164 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.153 -r1.154 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.623 -r1.624 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/lists/comp/ad.mips64eb
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/comp/ad.mips64el
cvs rdiff -u -r1.161 -r1.162 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.144 -r1.145 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.1750 -r1.1751 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.216 -r1.217 src/distrib/sets/lists/comp/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.88 src/distrib/sets/lists/base/ad.mips64eb:1.89
--- src/distrib/sets/lists/base/ad.mips64eb:1.88	Sat Apr  7 00:09:54 2012
+++ src/distrib/sets/lists/base/ad.mips64eb	Sat Apr  7 12:48:23 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.88 2012/04/07 04:09:54 christos Exp $
+# $NetBSD: ad.mips64eb,v 1.89 2012/04/07 16:48:23 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -265,7 +265,7 @@
 ./usr/lib/64/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/64/libutil.so.7.20			base-compat-shlib	compat,pic
+./usr/lib/64/libutil.so.7.21			base-compat-shlib	compat,pic
 ./usr/lib/64/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwrap.so.1			base-compat-shlib	compat,pic
@@ -563,7 +563,7 @@
 ./usr/lib/o32/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/o32/libutil.so.7.20			base-compat-shlib	compat,pic
+./usr/lib/o32/libutil.so.7.21			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.mips64el
diff -u src/distrib/sets/lists/base/ad.mips64el:1.87 src/distrib/sets/lists/base/ad.mips64el:1.88
--- src/distrib/sets/lists/base/ad.mips64el:1.87	Sat Apr  7 00:09:54 2012
+++ src/distrib/sets/lists/base/ad.mips64el	Sat Apr  7 12:48:23 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.87 2012/04/07 04:09:54 christos Exp $
+# $NetBSD: ad.mips64el,v 1.88 2012/04/07 16:48:23 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -265,7 +265,7 @@
 ./usr/lib/64/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/64/libutil.so.7.20			base-compat-shlib	compat,pic
+./usr/lib/64/libutil.so.7.21			base-compat-shlib	compat,pic
 ./usr/lib/64/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwrap.so.1			base-compat-shlib	compat,pic
@@ -563,7 +563,7 @@
 ./usr/lib/o32/libusbhid.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libusbhid.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/libutil.so.7			base-compat-shlib	compat,pic
-./usr/lib/o32/libutil.so.7.20			base-compat-shlib	compat,pic
+./usr/lib/o32/libutil.so.7.21			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwind.so.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.163 src/distrib/sets/lists/base/md.amd64:1.164
--- src/distrib/sets/lists/base/md.amd64:1.163	Sat Apr  7 00:09:54 2012
+++ src/distrib/sets/lists/base/md.amd64	Sat Apr  7 12:48:23 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.163 2012/04/07 04:09:54 christos Exp $
+# $NetBSD: md.amd64,v 1.164 2012/04/07 16:48:23 christos Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		

CVS commit: src/include

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:44:59 UTC 2012

Modified Files:
src/include: util.h

Log Message:
add getdisk{raw,cooked}name


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/include/util.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/include/util.h
diff -u src/include/util.h:1.62 src/include/util.h:1.63
--- src/include/util.h:1.62	Sat Apr  7 00:04:21 2012
+++ src/include/util.h	Sat Apr  7 12:44:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.h,v 1.62 2012/04/07 04:04:21 christos Exp $	*/
+/*	$NetBSD: util.h,v 1.63 2012/04/07 16:44:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995
@@ -73,6 +73,8 @@ int		getlabelsector(void);
 int		getlabelusesmbr(void);
 int		getmaxpartitions(void);
 int		getrawpartition(void);
+const char *getdiskrawname(char *, size_t, const char *);
+const char *getdiskcookedname(char *, size_t, const char *);
 const char *getfstypename(int);
 const char *getfsspecname(char *, size_t, const char *);
 #ifndef __LIBC12_SOURCE__



CVS commit: src/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:44:39 UTC 2012

Modified Files:
src/lib/libutil: Makefile shlib_version
Added Files:
src/lib/libutil: getdiskrawname.3 getdiskrawname.c

Log Message:
- add getdiskrawname.
- exit on error for lint.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/lib/libutil/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libutil/getdiskrawname.3 \
src/lib/libutil/getdiskrawname.c
cvs rdiff -u -r1.50 -r1.51 src/lib/libutil/shlib_version

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/Makefile
diff -u src/lib/libutil/Makefile:1.72 src/lib/libutil/Makefile:1.73
--- src/lib/libutil/Makefile:1.72	Sat Apr  7 00:04:45 2012
+++ src/lib/libutil/Makefile	Sat Apr  7 12:44:39 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.72 2012/04/07 04:04:45 christos Exp $
+#	$NetBSD: Makefile,v 1.73 2012/04/07 16:44:39 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -10,8 +10,9 @@ USE_SHLIBDIR=	yes
 WARNS?=	5
 LIB=	util
 CPPFLAGS+=-DLIBC_SCCS -I${.CURDIR}
+LINTFLAGS+=-w
 SRCS+=	efun.c getbootfile.c getlabelsector.c getmaxpartitions.c \
-	getfsspecname.c getmntopts.c getrawpartition.c \
+	getfsspecname.c getmntopts.c getrawpartition.c getdiskrawname.c \
 	disklabel_dkcksum.c disklabel_scan.c \
 	if_media.c \
 	login.c loginx.c login_cap.c login_tty.c logout.c logoutx.c \
@@ -23,7 +24,7 @@ SRCS+=	efun.c getbootfile.c getlabelsect
 
 MAN=	efun.3 getbootfile.3 getfstypename.3 getlabelsector.3 \
 	getmaxpartitions.3 getmntopts.3 getrawpartition.3 \
-	getfsspecname.3 \
+	getdiskrawname.3 getfsspecname.3 \
 	login.3 login_cap.3 loginx.3 \
 	disklabel_dkcksum.3 disklabel_scan.3 \
 	opendisk.3 openpty.3 parsedate.3 pidfile.3 pidlock.3 \
@@ -39,6 +40,7 @@ YPREFIX=__pd
 
 MLINKS+=getlabelsector.3 getlabeloffset.3
 MLINKS+=getlabelsector.3 getlabelusesmbr.3
+MLINKS+=getdiskrawname.3 getdiskcookedname.3
 MLINKS+=login.3 logout.3
 MLINKS+=login.3 logwtmp.3
 MLINKS+=login_cap.3 login_getclass.3

Index: src/lib/libutil/shlib_version
diff -u src/lib/libutil/shlib_version:1.50 src/lib/libutil/shlib_version:1.51
--- src/lib/libutil/shlib_version:1.50	Sat Apr  7 00:04:45 2012
+++ src/lib/libutil/shlib_version	Sat Apr  7 12:44:39 2012
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.50 2012/04/07 04:04:45 christos Exp $
+#	$NetBSD: shlib_version,v 1.51 2012/04/07 16:44:39 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 major=7
-minor=20
+minor=21

Added files:

Index: src/lib/libutil/getdiskrawname.3
diff -u /dev/null src/lib/libutil/getdiskrawname.3:1.1
--- /dev/null	Sat Apr  7 12:44:40 2012
+++ src/lib/libutil/getdiskrawname.3	Sat Apr  7 12:44:39 2012
@@ -0,0 +1,71 @@
+.\"	$NetBSD: getdiskrawname.3,v 1.1 2012/04/07 16:44:39 christos Exp $
+.\"
+.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Christos Zoulas.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\"
+.Dd March 7, 2012
+.Dt GETDISKRAWNAME 3
+.Os
+.Sh NAME
+.Nm getdiskrawname
+.Nd get the the block/character device name for a disk
+.Sh LIBRARY
+.Lb libutil
+.Sh SYNOPSIS
+.In util.h
+.Ft const char *
+.Fn getdiskrawname "char *buf" "size_t buflen" "const char *name"
+.Ft const char *
+.Fn getdiskcookedname "char *buf" "size_t buflen" "const char *name"
+.Sh DESCRIPTION
+The
+.Fn getdiskrawname
+function converts the
+.Fa name
+argument thar contains a path to a disk block device node to the
+path that contains the corresponding character dev

CVS commit: src/sbin

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:44:10 UTC 2012

Modified Files:
src/sbin/dump: main.c optr.c
src/sbin/fsck: fsutil.c fsutil.h
src/sbin/savecore: savecore.c

Log Message:
factor out rawname() from dump, fsck, savecore.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sbin/dump/main.c
cvs rdiff -u -r1.37 -r1.38 src/sbin/dump/optr.c
cvs rdiff -u -r1.21 -r1.22 src/sbin/fsck/fsutil.c
cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck/fsutil.h
cvs rdiff -u -r1.84 -r1.85 src/sbin/savecore/savecore.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/dump/main.c
diff -u src/sbin/dump/main.c:1.68 src/sbin/dump/main.c:1.69
--- src/sbin/dump/main.c:1.68	Sat Apr  7 00:52:20 2012
+++ src/sbin/dump/main.c	Sat Apr  7 12:44:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $	*/
+/*	$NetBSD: main.c,v 1.69 2012/04/07 16:44:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.68 2012/04/07 04:52:20 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.69 2012/04/07 16:44:10 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
 	char *mountpoint;
 	int just_estimate = 0;
 	char labelstr[LBLSIZE];
-	char buf[MAXPATHLEN];
+	char buf[MAXPATHLEN], rbuf[MAXPATHLEN];
 	char *new_time_format;
 	char *snap_backup = NULL;
 
@@ -408,11 +408,17 @@ main(int argc, char *argv[])
 	if ((dt = fstabsearch(disk)) != NULL) {
 		if (getfsspecname(buf, sizeof(buf), dt->fs_spec) == NULL)
 			quit("%s (%s)", buf, strerror(errno));
-		disk = rawname(buf);
+		if (getdiskrawname(rbuf, sizeof(rbuf), buf) == NULL)
+			quit("Can't get disk raw name for `%s' (%s)",
+			buf, strerror(errno));
+		disk = rbuf;
 		mountpoint = dt->fs_file;
 		msg("Found %s on %s in %s\n", disk, mountpoint, _PATH_FSTAB);
 	} else if (mntinfo != NULL) {
-		disk = rawname(mntinfo->f_mntfromname);
+		if (getdiskrawname(rbuf, sizeof(rbuf), mntinfo->f_mntfromname)
+		== NULL)
+			quit("Can't get disk raw name for `%s' (%s)",
+			mntinfo->f_mntfromname, strerror(errno));
 		mountpoint = mntinfo->f_mntonname;
 		msg("Found %s on %s in mount table\n", disk, mountpoint);
 	}
@@ -721,20 +727,6 @@ sig(int signo)
 	}
 }
 
-char *
-rawname(char *cp)
-{
-	static char rawbuf[MAXPATHLEN];
-	char *dp = strrchr(cp, '/');
-
-	if (dp == NULL)
-		return (NULL);
-	*dp = '\0';
-	(void)snprintf(rawbuf, sizeof rawbuf, "%s/r%s", cp, dp + 1);
-	*dp = '/';
-	return (rawbuf);
-}
-
 /*
  * obsolete --
  *	Change set of key letters and ordered arguments into something

Index: src/sbin/dump/optr.c
diff -u src/sbin/dump/optr.c:1.37 src/sbin/dump/optr.c:1.38
--- src/sbin/dump/optr.c:1.37	Sat Apr  7 00:52:20 2012
+++ src/sbin/dump/optr.c	Sat Apr  7 12:44:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $	*/
+/*	$NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)optr.c	8.2 (Berkeley) 1/6/94";
 #else
-__RCSID("$NetBSD: optr.c,v 1.37 2012/04/07 04:52:20 christos Exp $");
+__RCSID("$NetBSD: optr.c,v 1.38 2012/04/07 16:44:10 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -391,14 +391,15 @@ fstabsearch(const char *key)
 {
 	struct pfstab *pf;
 	struct fstab *fs;
-	char *rn;
+	const char *rn;
+	char buf[MAXPATHLEN];
 
 	SLIST_FOREACH(pf, &table, pf_list) {
 		fs = pf->pf_fstab;
 		if (strcmp(fs->fs_file, key) == 0 ||
 		strcmp(fs->fs_spec, key) == 0)
 			return (fs);
-		rn = rawname(fs->fs_spec);
+		rn = getdiskrawname(buf, sizeof(buf), fs->fs_spec);
 		if (rn != NULL && strcmp(rn, key) == 0)
 			return (fs);
 		if (key[0] != '/') {
@@ -427,7 +428,8 @@ mntinfosearch(const char *key)
 {
 	int i, mntbufc;
 	struct statvfs *mntbuf, *fs;
-	char *rn;
+	const char *rn;
+	char buf[MAXPATHLEN];
 
 	if ((mntbufc = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)
 		quit("Can't get mount list: %s", strerror(errno));
@@ -443,7 +445,7 @@ mntinfosearch(const char *key)
 		if (strcmp(fs->f_mntonname, key) == 0 ||
 		strcmp(fs->f_mntfromname, key) == 0)
 			return (fs);
-		rn = rawname(fs->f_mntfromname);
+		rn = getdiskrawname(buf, sizeof(buf), fs->f_mntfromname);
 		if (rn != NULL && strcmp(rn, key) == 0)
 			return (fs);
 	}

Index: src/sbin/fsck/fsutil.c
diff -u src/sbin/fsck/fsutil.c:1.21 src/sbin/fsck/fsutil.c:1.22
--- src/sbin/fsck/fsutil.c:1.21	Sat Apr  7 00:52:20 2012
+++ src/sbin/fsck/fsutil.c	Sat Apr  7 12:44:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsutil.c,v 1.21 2012/04/07 04:52:20 christos Exp $	*/
+/*	$NetBSD: fsutil.c,v 1.22 2012/04/07 16:44:10 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSI

CVS commit: src/etc

2012-04-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sat Apr  7 16:39:32 UTC 2012

Modified Files:
src/etc: rc.subr

Log Message:
The error message when /var is not a file system chhanged from
mount: unknown special file or file system `/var'
to
mount: Unknown special file or file system `/var'
so match them both.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/etc/rc.subr

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.88 src/etc/rc.subr:1.89
--- src/etc/rc.subr:1.88	Thu Aug 11 22:52:47 2011
+++ src/etc/rc.subr	Sat Apr  7 16:39:32 2012
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.88 2011/08/11 22:52:47 apb Exp $
+# $NetBSD: rc.subr,v 1.89 2012/04/07 16:39:32 apb Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -152,7 +152,7 @@ mount_critical_filesystems()
 # multiple lines can't be good,
 # not even if $_optional is true
 ;;
-			*'unknown special file or file system'*)
+			*[uU]'nknown special file or file system'*)
 if $_optional; then
 	# ignore this error
 	print_rc_metadata \



CVS commit: src/common/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:28:59 UTC 2012

Modified Files:
src/common/lib/libutil: getfstypename.c

Log Message:
fix lint comment.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libutil/getfstypename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/getfstypename.c
diff -u src/common/lib/libutil/getfstypename.c:1.7 src/common/lib/libutil/getfstypename.c:1.8
--- src/common/lib/libutil/getfstypename.c:1.7	Sat Apr  7 12:18:24 2012
+++ src/common/lib/libutil/getfstypename.c	Sat Apr  7 12:28:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $	*/
+/*	$NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
 # include 
 # ifndef _KERNEL
 #  if !defined(lint)
-__RCSID("$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $");
+__RCSID("$NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $");
 #  endif
 # else
-__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.8 2012/04/07 16:28:59 christos Exp $");
 # endif /* _KERNEL */
 
 # define FSTYPE_ENUMNAME fstype_enum
@@ -125,7 +125,7 @@ getfstypename(int fstype)
 		return DKW_PTYPE_MINIXFS3;
 	}
 	/* Stupid gcc, should know it is impossible to get here */
-	/*UNREACHED*/
+	/*NOTREACHED*/
 	return DKW_PTYPE_UNKNOWN;
 }
 #endif /* !_STANDALONE */



CVS commit: src/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:22:42 UTC 2012

Modified Files:
src/lib/libutil: getfsspecname.3

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libutil/getfsspecname.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/getfsspecname.3
diff -u src/lib/libutil/getfsspecname.3:1.2 src/lib/libutil/getfsspecname.3:1.3
--- src/lib/libutil/getfsspecname.3:1.2	Sat Apr  7 06:43:38 2012
+++ src/lib/libutil/getfsspecname.3	Sat Apr  7 12:22:42 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getfsspecname.3,v 1.2 2012/04/07 10:43:38 wiz Exp $
+.\"	$NetBSD: getfsspecname.3,v 1.3 2012/04/07 16:22:42 christos Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .Nm getfsspecname
 .Nd get the underlying wedge name from a label
 .Sh LIBRARY
-.Lb libutl
+.Lb libutil
 .Sh SYNOPSIS
 .In util.h
 .Ft const char *



CVS commit: src/common/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:18:24 UTC 2012

Modified Files:
src/common/lib/libutil: getfstypename.c

Log Message:
lint knows the code is not reachable, but gcc does not.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libutil/getfstypename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libutil/getfstypename.c
diff -u src/common/lib/libutil/getfstypename.c:1.6 src/common/lib/libutil/getfstypename.c:1.7
--- src/common/lib/libutil/getfstypename.c:1.6	Mon Jan 16 13:47:57 2012
+++ src/common/lib/libutil/getfstypename.c	Sat Apr  7 12:18:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getfstypename.c,v 1.6 2012/01/16 18:47:57 christos Exp $	*/
+/*	$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -39,10 +39,10 @@
 # include 
 # ifndef _KERNEL
 #  if !defined(lint)
-__RCSID("$NetBSD: getfstypename.c,v 1.6 2012/01/16 18:47:57 christos Exp $");
+__RCSID("$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $");
 #  endif
 # else
-__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.6 2012/01/16 18:47:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: getfstypename.c,v 1.7 2012/04/07 16:18:24 christos Exp $");
 # endif /* _KERNEL */
 
 # define FSTYPE_ENUMNAME fstype_enum
@@ -125,6 +125,7 @@ getfstypename(int fstype)
 		return DKW_PTYPE_MINIXFS3;
 	}
 	/* Stupid gcc, should know it is impossible to get here */
+	/*UNREACHED*/
 	return DKW_PTYPE_UNKNOWN;
 }
 #endif /* !_STANDALONE */



CVS commit: src/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:17:17 UTC 2012

Modified Files:
src/lib/libutil: pidlock.c

Log Message:
read returns ssize_t, and err is a function name.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libutil/pidlock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/pidlock.c
diff -u src/lib/libutil/pidlock.c:1.15 src/lib/libutil/pidlock.c:1.16
--- src/lib/libutil/pidlock.c:1.15	Sun Jan 18 07:13:04 2009
+++ src/lib/libutil/pidlock.c	Sat Apr  7 12:17:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pidlock.c,v 1.15 2009/01/18 12:13:04 lukem Exp $ */
+/*	$NetBSD: pidlock.c,v 1.16 2012/04/07 16:17:17 christos Exp $ */
 
 /*
  * Copyright 1996, 1997 by Curt Sampson .
@@ -24,7 +24,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: pidlock.c,v 1.15 2009/01/18 12:13:04 lukem Exp $");
+__RCSID("$NetBSD: pidlock.c,v 1.16 2012/04/07 16:17:17 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -52,8 +52,8 @@ pidlock(const char *lockfile, int flags,
 	char	hostname[MAXHOSTNAMELEN + 1];
 	pid_t	pid2 = -1;
 	struct	stat st;
-	int	err;
-	int	f = -1;
+	ssize_t	n;
+	int	f = -1, savee;
 	char	s[256];
 	char	*p;
 	size_t	len;
@@ -114,16 +114,16 @@ lockfailed:
 			goto out;
 		/* Find out who has this lockfile. */
 		if ((f = open(lockfile, O_RDONLY, 0)) != -1)  {
-			if ((err = read(f, s, (size_t)11)) == -1)
+			if ((n = read(f, s, (size_t)11)) == -1)
 goto out;
-			if (err == 0) {
+			if (n == 0) {
 errno = EINVAL;
 goto out;
 			}
 			pid2 = atoi(s);
-			if ((err = read(f, s, sizeof(s) - 2)) == -1)
+			if ((n = read(f, s, sizeof(s) - 2)) == -1)
 goto out;
-			if (err == 0)
+			if (n == 0)
 *s = '\0';
 			s[sizeof(s) - 1] = '\0';
 			if ((p = strchr(s, '\n')) != NULL)
@@ -164,11 +164,11 @@ lockfailed:
 	errno = 0;
 	return 0;
 out:
-	err = errno;
+	savee = errno;
 	if (f != -1)
 		(void)close(f);
 	(void)unlink(tempfile);
-	errno = err;
+	errno = savee;
 	return -1;
 }
 



CVS commit: src/lib/libutil

2012-04-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  7 16:16:34 UTC 2012

Modified Files:
src/lib/libutil: login_cap.c

Log Message:
- pass correct types.
- use sizeof(var) instead of sizeof(type)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libutil/login_cap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/login_cap.c
diff -u src/lib/libutil/login_cap.c:1.29 src/lib/libutil/login_cap.c:1.30
--- src/lib/libutil/login_cap.c:1.29	Tue Dec  4 17:09:02 2007
+++ src/lib/libutil/login_cap.c	Sat Apr  7 12:16:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: login_cap.c,v 1.29 2007/12/04 22:09:02 mjf Exp $	*/
+/*	$NetBSD: login_cap.c,v 1.30 2012/04/07 16:16:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: login_cap.c,v 1.29 2007/12/04 22:09:02 mjf Exp $");
+__RCSID("$NetBSD: login_cap.c,v 1.30 2012/04/07 16:16:34 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
  
 #include 
@@ -444,25 +444,25 @@ gsetrl(login_cap_t *lc, int what, const 
 		return (-1);
 	}
 
-#define	RCUR	r.rlim_cur
-#define	RMAX	r.rlim_max
+#define	RCUR	((quad_t)r.rlim_cur)
+#define	RMAX	((quad_t)r.rlim_max)
 
 	switch (type) {
 	case R_CTIME:
-		RCUR = login_getcaptime(lc, name, RCUR, RCUR);
-		RMAX = login_getcaptime(lc, name, RMAX, RMAX);
+		r.rlim_cur = login_getcaptime(lc, name, RCUR, RCUR);
+		r.rlim_max = login_getcaptime(lc, name, RMAX, RMAX);
 		rl.rlim_cur = login_getcaptime(lc, name_cur, RCUR, RCUR);
 		rl.rlim_max = login_getcaptime(lc, name_max, RMAX, RMAX);
 		break;
 	case R_CSIZE:
-		RCUR = login_getcapsize(lc, name, RCUR, RCUR);
-		RMAX = login_getcapsize(lc, name, RMAX, RMAX);
+		r.rlim_cur = login_getcapsize(lc, name, RCUR, RCUR);
+		r.rlim_max = login_getcapsize(lc, name, RMAX, RMAX);
 		rl.rlim_cur = login_getcapsize(lc, name_cur, RCUR, RCUR);
 		rl.rlim_max = login_getcapsize(lc, name_max, RMAX, RMAX);
 		break;
 	case R_CNUMB:
-		RCUR = login_getcapnum(lc, name, RCUR, RCUR);
-		RMAX = login_getcapnum(lc, name, RMAX, RMAX);
+		r.rlim_cur = login_getcapnum(lc, name, RCUR, RCUR);
+		r.rlim_max = login_getcapnum(lc, name, RMAX, RMAX);
 		rl.rlim_cur = login_getcapnum(lc, name_cur, RCUR, RCUR);
 		rl.rlim_max = login_getcapnum(lc, name_max, RMAX, RMAX);
 		break;
@@ -513,7 +513,7 @@ setuserenv(login_cap_t *lc, envfunc_t se
 
 	/* allocate ptr array and string */
 	count = i;
-	res = malloc(count * sizeof(char *) + strlen(str) + 1);
+	res = malloc(count * sizeof(*res) + strlen(str) + 1);
 
 	if (!res)
 		return -1;



CVS commit: src/sys/dev/usb

2012-04-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr  7 11:56:27 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.603 -r1.604 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.604 -r1.605 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.603 src/sys/dev/usb/usbdevs.h:1.604
--- src/sys/dev/usb/usbdevs.h:1.603	Sat Mar  3 21:33:23 2012
+++ src/sys/dev/usb/usbdevs.h	Sat Apr  7 11:56:27 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.603 2012/03/03 21:33:23 riz Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.604 2012/04/07 11:56:27 jakllsch Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.610 2012/03/03 21:32:58 riz Exp
+ *	NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp
  */
 
 /*
@@ -699,6 +699,7 @@
 /* ADS products */
 #define	USB_PRODUCT_ADS_UBS10BT	0x0008		/* UBS-10BT Ethernet */
 #define	USB_PRODUCT_ADS_UBS10BTX	0x0009		/* UBS-10BT Ethernet */
+#define	USB_PRODUCT_ADS_RDX155	0xa155		/* InstantFM Music */
 
 /* AEI products */
 #define	USB_PRODUCT_AEI_USBTOLAN	0x1701		/* AEI USB to Lan adapter */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.604 src/sys/dev/usb/usbdevs_data.h:1.605
--- src/sys/dev/usb/usbdevs_data.h:1.604	Sat Mar  3 21:33:24 2012
+++ src/sys/dev/usb/usbdevs_data.h	Sat Apr  7 11:56:27 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.604 2012/03/03 21:33:24 riz Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.605 2012/04/07 11:56:27 jakllsch Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.610 2012/03/03 21:32:58 riz Exp
+ *	NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp
  */
 
 /*
@@ -2431,6 +2431,10 @@ const struct usb_product usb_products[] 
 	"UBS-10BT Ethernet",
 	},
 	{
+	USB_VENDOR_ADS, USB_PRODUCT_ADS_RDX155,
+	"InstantFM Music",
+	},
+	{
 	USB_VENDOR_AEI, USB_PRODUCT_AEI_USBTOLAN,
 	"AEI USB to Lan adapter",
 	},
@@ -8831,4 +8835,4 @@ const struct usb_product usb_products[] 
 	"Prestige",
 	},
 };
-const int usb_nproducts = 1695;
+const int usb_nproducts = 1696;



CVS commit: src/sys/dev/usb

2012-04-07 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr  7 11:54:34 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add ADS InstantFM Music (RDX-155).


To generate a diff of this commit:
cvs rdiff -u -r1.610 -r1.611 src/sys/dev/usb/usbdevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.610 src/sys/dev/usb/usbdevs:1.611
--- src/sys/dev/usb/usbdevs:1.610	Sat Mar  3 21:32:58 2012
+++ src/sys/dev/usb/usbdevs	Sat Apr  7 11:54:34 2012
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.610 2012/03/03 21:32:58 riz Exp $
+$NetBSD: usbdevs,v 1.611 2012/04/07 11:54:34 jakllsch Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -692,6 +692,7 @@ product ADMTEK PEGASUSII_3	0x8515	ADM851
 /* ADS products */
 product ADS UBS10BT		0x0008	UBS-10BT Ethernet
 product ADS UBS10BTX		0x0009	UBS-10BT Ethernet
+product ADS RDX155		0xa155	InstantFM Music
 
 /* AEI products */
 product AEI USBTOLAN		0x1701	AEI USB to Lan adapter



CVS commit: src/usr.sbin/makemandb

2012-04-07 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sat Apr  7 10:44:58 UTC 2012

Modified Files:
src/usr.sbin/makemandb: apropos-utils.c

Log Message:
Add the result from sqlite3_errmsg() to some error messages.
Now we can get "apropos: Unable to query schema version: database is locked"
instead of just "apropos: Unable to query schema version".


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makemandb/apropos-utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/apropos-utils.c
diff -u src/usr.sbin/makemandb/apropos-utils.c:1.2 src/usr.sbin/makemandb/apropos-utils.c:1.3
--- src/usr.sbin/makemandb/apropos-utils.c:1.2	Tue Feb  7 19:17:16 2012
+++ src/usr.sbin/makemandb/apropos-utils.c	Sat Apr  7 10:44:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: apropos-utils.c,v 1.2 2012/02/07 19:17:16 joerg Exp $	*/
+/*	$NetBSD: apropos-utils.c,v 1.3 2012/04/07 10:44:58 apb Exp $	*/
 /*-
  * Copyright (c) 2011 Abhinav Upadhyay 
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: apropos-utils.c,v 1.2 2012/02/07 19:17:16 joerg Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.3 2012/04/07 10:44:58 apb Exp $");
 
 #include 
 
@@ -312,12 +312,14 @@ init_db(int db_flag)
 
 	rc = sqlite3_prepare_v2(db, "PRAGMA user_version", -1, &stmt, NULL);
 	if (rc != SQLITE_OK) {
-		warnx("Unable to query schema version");
+		warnx("Unable to query schema version: %s",
+		sqlite3_errmsg(db));
 		goto error;
 	}
 	if (sqlite3_step(stmt) != SQLITE_ROW) {
 		sqlite3_finalize(stmt);
-		warnx("Unable to query schema version");
+		warnx("Unable to query schema version: %s",
+		sqlite3_errmsg(db));
 		goto error;
 	}
 	if (sqlite3_column_int(stmt, 0) != APROPOS_SCHEMA_VERSION) {
@@ -333,14 +335,16 @@ init_db(int db_flag)
 	/* Register the zip and unzip functions for FTS compression */
 	rc = sqlite3_create_function(db, "zip", 1, SQLITE_ANY, NULL, zip, NULL, NULL);
 	if (rc != SQLITE_OK) {
-		warnx("Unable to register function: compress");
+		warnx("Unable to register function: compress: %s",
+		sqlite3_errmsg(db));
 		goto error;
 	}
 
 	rc = sqlite3_create_function(db, "unzip", 1, SQLITE_ANY, NULL, 
  unzip, NULL, NULL);
 	if (rc != SQLITE_OK) {
-		warnx("Unable to register function: uncompress");
+		warnx("Unable to register function: uncompress: %s",
+		sqlite3_errmsg(db));
 		goto error;
 	}
 	return db;
@@ -457,9 +461,11 @@ run_query(sqlite3 *db, const char *snipp
 	rc = sqlite3_create_function(db, "rank_func", 1, SQLITE_ANY, (void *)&idf, 
 	 rank_func, NULL, NULL);
 	if (rc != SQLITE_OK) {
+		warnx("Unable to register the ranking function: %s",
+		sqlite3_errmsg(db));
 		sqlite3_close(db);
 		sqlite3_shutdown();
-		errx(EXIT_FAILURE, "Unable to register the ranking function");
+		exit(EXIT_FAILURE);
 	}
 	
 	/* We want to build a query of the form: "select x,y,z from mandb where



CVS commit: src/lib/libutil

2012-04-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  7 10:43:39 UTC 2012

Modified Files:
src/lib/libutil: getfsspecname.3

Log Message:
Remove trailing whitespace, add dot.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libutil/getfsspecname.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libutil/getfsspecname.3
diff -u src/lib/libutil/getfsspecname.3:1.1 src/lib/libutil/getfsspecname.3:1.2
--- src/lib/libutil/getfsspecname.3:1.1	Sat Apr  7 04:04:45 2012
+++ src/lib/libutil/getfsspecname.3	Sat Apr  7 10:43:38 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getfsspecname.3,v 1.1 2012/04/07 04:04:45 christos Exp $
+.\"	$NetBSD: getfsspecname.3,v 1.2 2012/04/07 10:43:38 wiz Exp $
 .\"
 .\" Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -49,10 +49,10 @@ field in the
 .Fa spec
 argument of the form
 .Dq NAME=wedgename
-to the underlying 
-.Xr dk 4 
+to the underlying
+.Xr dk 4
 device node, and places the resulting pathname in
-.Fa buf 
+.Fa buf
 up to len
 .Fa bufsiz .
 .Pp
@@ -81,4 +81,4 @@ contains the reason for the error.
 The
 .Fn getfsspecname
 function appeared in
-.Nx 7.0
+.Nx 7.0 .



CVS commit: src

2012-04-07 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Apr  7 09:10:47 UTC 2012

Modified Files:
src/distrib/zaurus/ramdisk: Makefile
src/sys/arch/zaurus/conf: INSTALL

Log Message:
bump up ramdisk size.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/zaurus/ramdisk/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/zaurus/conf/INSTALL

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/zaurus/ramdisk/Makefile
diff -u src/distrib/zaurus/ramdisk/Makefile:1.14 src/distrib/zaurus/ramdisk/Makefile:1.15
--- src/distrib/zaurus/ramdisk/Makefile:1.14	Fri May 20 07:57:07 2011
+++ src/distrib/zaurus/ramdisk/Makefile	Sat Apr  7 09:10:47 2012
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.14 2011/05/20 07:57:07 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.15 2012/04/07 09:10:47 nonaka Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2048k
+IMAGESIZE=	2112k
 MAKEFS_FLAGS=	-f 14
 
 WARNS=		1

Index: src/sys/arch/zaurus/conf/INSTALL
diff -u src/sys/arch/zaurus/conf/INSTALL:1.14 src/sys/arch/zaurus/conf/INSTALL:1.15
--- src/sys/arch/zaurus/conf/INSTALL:1.14	Sat Mar 10 21:51:57 2012
+++ src/sys/arch/zaurus/conf/INSTALL	Sat Apr  7 09:10:47 2012
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.14 2012/03/10 21:51:57 joerg Exp $
+# $NetBSD: INSTALL,v 1.15 2012/04/07 09:10:47 nonaka Exp $
 #
 # INSTALL config file (GENERIC with memory disk root)
 #
@@ -9,7 +9,7 @@ include 	"arch/zaurus/conf/GENERIC"
 options 	MEMORY_DISK_HOOKS	# enable root ramdisk
 options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=4096	# size of memory disk, in blocks
+options 	MEMORY_DISK_ROOT_SIZE=4224	# size of memory disk, in blocks
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 # for reduce kernel size.



CVS commit: src/sys/arch/zaurus/conf

2012-04-07 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Apr  7 09:09:43 UTC 2012

Modified Files:
src/sys/arch/zaurus/conf: GENERIC

Log Message:
bump up SYMTAB_SPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/zaurus/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/zaurus/conf/GENERIC
diff -u src/sys/arch/zaurus/conf/GENERIC:1.52 src/sys/arch/zaurus/conf/GENERIC:1.53
--- src/sys/arch/zaurus/conf/GENERIC:1.52	Sat Mar 10 21:51:57 2012
+++ src/sys/arch/zaurus/conf/GENERIC	Sat Apr  7 09:09:43 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC,v 1.52 2012/03/10 21:51:57 joerg Exp $
+#	$NetBSD: GENERIC,v 1.53 2012/04/07 09:09:43 nonaka Exp $
 #
 # GENERIC machine description file
 #
@@ -164,7 +164,7 @@ options 	DDB			# in-kernel debugger
 options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #options 	KGDB
 #makeoptions 	DEBUG="-g"		# compile full symbol table
-options 	SYMTAB_SPACE=512000
+options 	SYMTAB_SPACE=64
 
 
 # Kernel root file system and dump configuration.