CVS commit: src/usr.bin/gettext

2015-06-03 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Jun  3 23:15:22 UTC 2015

Modified Files:
src/usr.bin/gettext: gettext.c

Log Message:
Fix expand() to process successive escape sequences correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/gettext/gettext.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/gettext/gettext.c
diff -u src/usr.bin/gettext/gettext.c:1.1 src/usr.bin/gettext/gettext.c:1.2
--- src/usr.bin/gettext/gettext.c:1.1	Wed Jun  3 14:32:17 2015
+++ src/usr.bin/gettext/gettext.c	Wed Jun  3 23:15:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: gettext.c,v 1.1 2015/06/03 14:32:17 christos Exp $	*/
+/*	$NetBSD: gettext.c,v 1.2 2015/06/03 23:15:22 enami Exp $	*/
 
 /*-
  * Copyright (c) 2015 William Orr w...@worrbase.com
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: gettext.c,v 1.1 2015/06/03 14:32:17 christos Exp $);
+__RCSID($NetBSD: gettext.c,v 1.2 2015/06/03 23:15:22 enami Exp $);
 
 #include err.h
 #include errno.h
@@ -116,6 +116,7 @@ expand(char *str)
 *sp++ = '\\';
 break;
 			}
+			continue;
 		}
 		*sp++ = *fp++;
 	}



CVS commit: src/bin/cp

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 00:20:38 UTC 2015

Modified Files:
src/bin/cp: utils.c

Log Message:
Fix the name of failed function in warning message.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/bin/cp/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/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.43 src/bin/cp/utils.c:1.44
--- src/bin/cp/utils.c:1.43	Mon Mar  2 03:17:24 2015
+++ src/bin/cp/utils.c	Tue Mar  3 00:20:38 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $ */
+/* $NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)utils.c	8.3 (Berkeley) 4/1/94;
 #else
-__RCSID($NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $);
+__RCSID($NetBSD: utils.c,v 1.44 2015/03/03 00:20:38 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -68,7 +68,7 @@ set_utimes(const char *file, struct stat
 ts[1] = fs-st_mtimespec;
 
 if (lutimens(file, ts)) {
-	warn(lutimes: %s, file);
+	warn(lutimens: %s, file);
 	return (1);
 }
 return (0);



CVS commit: src/lib/librumphijack

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 00:19:07 UTC 2015

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Hijack utimensat(2) so that t_vfs test passes after cp(1)/mv(1) are
changed to use the system call.  Linux also has this system call, but
not tested this on linux.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.111 src/lib/librumphijack/hijack.c:1.112
--- src/lib/librumphijack/hijack.c:1.111	Tue Nov  4 19:05:17 2014
+++ src/lib/librumphijack/hijack.c	Tue Mar  3 00:19:07 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.111 2014/11/04 19:05:17 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include rump/rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: hijack.c,v 1.111 2014/11/04 19:05:17 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $);
 #endif
 
 #include sys/param.h
@@ -113,6 +113,7 @@ enum dualcall {
 	DUALCALL_LINK, DUALCALL_RENAME,
 	DUALCALL_MKDIR, DUALCALL_RMDIR,
 	DUALCALL_UTIMES, DUALCALL_LUTIMES, DUALCALL_FUTIMES,
+	DUALCALL_UTIMENSAT,
 	DUALCALL_TRUNCATE, DUALCALL_FTRUNCATE,
 	DUALCALL_FSYNC,
 	DUALCALL_ACCESS,
@@ -305,6 +306,7 @@ struct sysnames {
 	{ DUALCALL_UTIMES,	S(REALUTIMES),	RSYS_NAME(UTIMES)	},
 	{ DUALCALL_LUTIMES,	S(REALLUTIMES),	RSYS_NAME(LUTIMES)	},
 	{ DUALCALL_FUTIMES,	S(REALFUTIMES),	RSYS_NAME(FUTIMES)	},
+	{ DUALCALL_UTIMENSAT,	utimensat,	RSYS_NAME(UTIMENSAT)	},
 	{ DUALCALL_OPEN,	open,		RSYS_NAME(OPEN)		},
 	{ DUALCALL_CHDIR,	chdir,	RSYS_NAME(CHDIR)	},
 	{ DUALCALL_FCHDIR,	fchdir,	RSYS_NAME(FCHDIR)	},
@@ -2496,6 +2498,11 @@ PATHCALL(int, lutimes, DUALCALL_LUTIMES,
 	(const char *, const struct timeval *),\
 	(path, tv))
 
+PATHCALL(int, utimensat, DUALCALL_UTIMENSAT,\
+	(int fd, const char *path, const struct timespec *ts, int flags), \
+	(int, const char *, const struct timespec *, int),		\
+	(fd, path, ts, flags))
+
 #ifdef HAVE_CHFLAGS
 PATHCALL(int, chflags, DUALCALL_CHFLAGS,\
 	(const char *path, u_long flags),\



CVS commit: src/lib/librumphijack

2015-03-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  3 01:24:39 UTC 2015

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Also hijack futimens(2) so that t_sh test passes.


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.112 src/lib/librumphijack/hijack.c:1.113
--- src/lib/librumphijack/hijack.c:1.112	Tue Mar  3 00:19:07 2015
+++ src/lib/librumphijack/hijack.c	Tue Mar  3 01:24:39 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $	*/
+/*  $NetBSD: hijack.c,v 1.113 2015/03/03 01:24:39 enami Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include rump/rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: hijack.c,v 1.112 2015/03/03 00:19:07 enami Exp $);
+__RCSID($NetBSD: hijack.c,v 1.113 2015/03/03 01:24:39 enami Exp $);
 #endif
 
 #include sys/param.h
@@ -113,7 +113,7 @@ enum dualcall {
 	DUALCALL_LINK, DUALCALL_RENAME,
 	DUALCALL_MKDIR, DUALCALL_RMDIR,
 	DUALCALL_UTIMES, DUALCALL_LUTIMES, DUALCALL_FUTIMES,
-	DUALCALL_UTIMENSAT,
+	DUALCALL_UTIMENSAT, DUALCALL_FUTIMENS,
 	DUALCALL_TRUNCATE, DUALCALL_FTRUNCATE,
 	DUALCALL_FSYNC,
 	DUALCALL_ACCESS,
@@ -307,6 +307,7 @@ struct sysnames {
 	{ DUALCALL_LUTIMES,	S(REALLUTIMES),	RSYS_NAME(LUTIMES)	},
 	{ DUALCALL_FUTIMES,	S(REALFUTIMES),	RSYS_NAME(FUTIMES)	},
 	{ DUALCALL_UTIMENSAT,	utimensat,	RSYS_NAME(UTIMENSAT)	},
+	{ DUALCALL_FUTIMENS,	futimens,	RSYS_NAME(FUTIMENS)	},
 	{ DUALCALL_OPEN,	open,		RSYS_NAME(OPEN)		},
 	{ DUALCALL_CHDIR,	chdir,	RSYS_NAME(CHDIR)	},
 	{ DUALCALL_FCHDIR,	fchdir,	RSYS_NAME(FCHDIR)	},
@@ -2392,6 +2393,11 @@ FDCALL(int, futimes, DUALCALL_FUTIMES,		
 	(int, const struct timeval *),	\
 	(fd, tv))
 
+FDCALL(int, futimens, DUALCALL_FUTIMENS,\
+	(int fd, const struct timespec *ts),\
+	(int, const struct timespec *),	\
+	(fd, ts))
+
 #ifdef HAVE_CHFLAGS
 FDCALL(int, fchflags, DUALCALL_FCHFLAGS,\
 	(int fd, u_long flags),		\



CVS commit: src

2015-03-01 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar  2 03:17:24 UTC 2015

Modified Files:
src/bin/cp: utils.c
src/bin/mv: mv.c
src/sbin/restore: dirs.c tape.c
src/usr.bin/touch: touch.c

Log Message:
Don't truncate at sub-microsecond while preserving timestamps.

One of motivation of this change is to make the behavior of test(1)
-nt/ot with preserved copy (like cp -p) closer to the NetBSD 6.
Of course whether full timestamps are kept or not depends also on
underlying file system.

The ifdef added in mv(1) since existing ifdefs was our local change
to compile it on solaris (though I couldn't test it):
http://mail-index.netbsd.org/tech-userlevel/2014/11/28/msg008831.html


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/bin/cp/utils.c
cvs rdiff -u -r1.43 -r1.44 src/bin/mv/mv.c
cvs rdiff -u -r1.50 -r1.51 src/sbin/restore/dirs.c
cvs rdiff -u -r1.67 -r1.68 src/sbin/restore/tape.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/touch/touch.c

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

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.42 src/bin/cp/utils.c:1.43
--- src/bin/cp/utils.c:1.42	Wed Dec 11 06:00:11 2013
+++ src/bin/cp/utils.c	Mon Mar  2 03:17:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.42 2013/12/11 06:00:11 dholland Exp $ */
+/* $NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)utils.c	8.3 (Berkeley) 4/1/94;
 #else
-__RCSID($NetBSD: utils.c,v 1.42 2013/12/11 06:00:11 dholland Exp $);
+__RCSID($NetBSD: utils.c,v 1.43 2015/03/02 03:17:24 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -62,12 +62,12 @@ __RCSID($NetBSD: utils.c,v 1.42 2013/12
 int
 set_utimes(const char *file, struct stat *fs)
 {
-static struct timeval tv[2];
+struct timespec ts[2];
 
-TIMESPEC_TO_TIMEVAL(tv[0], fs-st_atimespec);
-TIMESPEC_TO_TIMEVAL(tv[1], fs-st_mtimespec);
+ts[0] = fs-st_atimespec;
+ts[1] = fs-st_mtimespec;
 
-if (lutimes(file, tv)) {
+if (lutimens(file, ts)) {
 	warn(lutimes: %s, file);
 	return (1);
 }

Index: src/bin/mv/mv.c
diff -u src/bin/mv/mv.c:1.43 src/bin/mv/mv.c:1.44
--- src/bin/mv/mv.c:1.43	Mon Aug 29 14:46:54 2011
+++ src/bin/mv/mv.c	Mon Mar  2 03:17:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $ */
+/* $NetBSD: mv.c,v 1.44 2015/03/02 03:17:24 enami Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)mv.c	8.2 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: mv.c,v 1.43 2011/08/29 14:46:54 joerg Exp $);
+__RCSID($NetBSD: mv.c,v 1.44 2015/03/02 03:17:24 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -255,7 +255,11 @@ do_move(char *from, char *to)
 static int
 fastcopy(char *from, char *to, struct stat *sbp)
 {
+#if defined(__NetBSD__)
+	struct timespec ts[2];
+#else
 	struct timeval tval[2];
+#endif
 	static blksize_t blen;
 	static char *bp;
 	int nread, from_fd, to_fd;
@@ -296,8 +300,13 @@ err:		if (unlink(to))
 
 	(void)close(from_fd);
 #ifdef BSD4_4
+#if defined(__NetBSD__)
+	ts[0] = sbp-st_atimespec;
+	ts[1] = sbp-st_mtimespec;
+#else
 	TIMESPEC_TO_TIMEVAL(tval[0], sbp-st_atimespec);
 	TIMESPEC_TO_TIMEVAL(tval[1], sbp-st_mtimespec);
+#endif
 #else
 	tval[0].tv_sec = sbp-st_atime;
 	tval[1].tv_sec = sbp-st_mtime;
@@ -307,8 +316,12 @@ err:		if (unlink(to))
 #ifdef __SVR4
 	if (utimes(to, tval))
 #else
+#if defined(__NetBSD__)
+	if (futimens(to_fd, ts))
+#else
 	if (futimes(to_fd, tval))
 #endif
+#endif
 		warn(%s: set times, to);
 	if (fchown(to_fd, sbp-st_uid, sbp-st_gid)) {
 		if (errno != EPERM)

Index: src/sbin/restore/dirs.c
diff -u src/sbin/restore/dirs.c:1.50 src/sbin/restore/dirs.c:1.51
--- src/sbin/restore/dirs.c:1.50	Sun Jun  9 17:57:09 2013
+++ src/sbin/restore/dirs.c	Mon Mar  2 03:17:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dirs.c,v 1.50 2013/06/09 17:57:09 dholland Exp $	*/
+/*	$NetBSD: dirs.c,v 1.51 2015/03/02 03:17:24 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)dirs.c	8.7 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: dirs.c,v 1.50 2013/06/09 17:57:09 dholland Exp $);
+__RCSID($NetBSD: dirs.c,v 1.51 2015/03/02 03:17:24 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -84,8 +84,8 @@ static struct inotab *inotab[HASHSIZE];
  */
 struct modeinfo {
 	ino_t ino;
-	struct timeval ctimep[2];
-	struct timeval mtimep[2];
+	struct timespec ctimep[2];
+	struct timespec mtimep[2];
 	mode_t mode;
 	uid_t uid;
 	gid_t gid;
@@ -625,8 +625,8 @@ setdirmodes(int flags)
 		} else {
 			if (!Nflag) {
 cp = myname(ep);
-(void) utimes(cp, node.ctimep);
-(void) utimes(cp, node.mtimep);
+(void) utimens(cp, node.ctimep);
+(void) utimens(cp, node.mtimep);
 (void) chown(cp, node.uid, node.gid);
 (void) chmod(cp, node.mode);
 

CVS commit: src

2014-11-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Nov 26 23:44:21 UTC 2014

Modified Files:
src/lib/libc/net: rcmd.c
src/usr.bin/rsh: rsh.c

Log Message:
Changes done in rsh.c rev. 1.35 was incomplete.  As chuq pointed
in private mail, it broke rcp(1).

To achieve the documented behavior and to fix long standing incorrect
rsh(1) behavior which I've tried to fix in rev. 1.35, rcmd(1) should have
two operation mode; whether it should relay signal information on
auxiliary channel or not, depending on the argument `fd2p' passed to rcmd(3).
So, make rcmd(1) behave differntly depending on the environment variable and
set it when necessary in rcmd(3) according to how auxiliary channel
is set up by rcmd(3).


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/lib/libc/net/rcmd.c
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/rsh/rsh.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/libc/net/rcmd.c
diff -u src/lib/libc/net/rcmd.c:1.70 src/lib/libc/net/rcmd.c:1.71
--- src/lib/libc/net/rcmd.c:1.70	Thu Sep 18 13:58:20 2014
+++ src/lib/libc/net/rcmd.c	Wed Nov 26 23:44:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rcmd.c,v 1.70 2014/09/18 13:58:20 christos Exp $	*/
+/*	$NetBSD: rcmd.c,v 1.71 2014/11/26 23:44:21 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)rcmd.c	8.3 (Berkeley) 3/26/94;
 #else
-__RCSID($NetBSD: rcmd.c,v 1.70 2014/09/18 13:58:20 christos Exp $);
+__RCSID($NetBSD: rcmd.c,v 1.71 2014/11/26 23:44:21 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -464,6 +464,9 @@ rshrcmd(int af, char **ahost, u_int32_t 
 			const char *program;
 			program = strrchr(rshcmd, '/');
 			program = program ? program + 1 : rshcmd;
+			if (fd2p)
+/* ask rcmd to relay signal information */
+setenv(RCMD_RELAY_SIGNAL, YES, 1);
 			switch (af) {
 			case AF_INET:
 execlp(rshcmd, program, -4, -l, remuser,

Index: src/usr.bin/rsh/rsh.c
diff -u src/usr.bin/rsh/rsh.c:1.37 src/usr.bin/rsh/rsh.c:1.38
--- src/usr.bin/rsh/rsh.c:1.37	Thu Oct 30 06:13:50 2014
+++ src/usr.bin/rsh/rsh.c	Wed Nov 26 23:44:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rsh.c,v 1.37 2014/10/30 06:13:50 dholland Exp $	*/
+/*	$NetBSD: rsh.c,v 1.38 2014/11/26 23:44:21 enami Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1990, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)rsh.c	8.4 (Berkeley) 4/29/95;
 #else
-__RCSID($NetBSD: rsh.c,v 1.37 2014/10/30 06:13:50 dholland Exp $);
+__RCSID($NetBSD: rsh.c,v 1.38 2014/11/26 23:44:21 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -76,9 +76,7 @@ int	remerr;
 static int sigs[] = { SIGINT, SIGTERM, SIGQUIT };
 
 static char   *copyargs(char **);
-#ifndef IN_RCMD
 static void	sendsig(int);
-#endif
 static int	checkfd(struct pollfd *, int);
 static void	talk(int, sigset_t *, pid_t, int);
 __dead static void	usage(void);
@@ -87,6 +85,7 @@ int	 orcmd(char **, int, const char *,
 const char *, const char *, int *);
 int	 orcmd_af(char **, int, const char *,
 const char *, const char *, int *, int);
+static int	relay_signal;
 #endif
 
 int
@@ -98,7 +97,7 @@ main(int argc, char **argv)
 	struct protoent *proto;
 
 #ifdef IN_RCMD
-	char	*locuser = 0, *loop;
+	char	*locuser = 0, *loop, *relay;
 #endif /* IN_RCMD */
 	int argoff, asrsh, ch, dflag, nflag, one, rem;
 	size_t i;
@@ -133,6 +132,8 @@ main(int argc, char **argv)
 	}
 
 #ifdef IN_RCMD
+	if ((relay = getenv(RCMD_RELAY_SIGNAL))  strcmp(relay, YES) == 0)
+		relay_signal = 1;
 	if ((loop = getenv(RCMD_LOOP))  strcmp(loop, YES) == 0)
 		warnx(rcmd appears to be looping!);
 
@@ -152,7 +153,7 @@ main(int argc, char **argv)
 	if ((name = strdup(pw-pw_name)) == NULL)
 		err(1, malloc);
 	while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1)
-		switch(ch) {
+		switch (ch) {
 		case '4':
 			family = AF_INET;
 			break;
@@ -268,16 +269,17 @@ main(int argc, char **argv)
 
 	(void)sigprocmask(SIG_BLOCK, nset, oset);
 
-#ifndef IN_RCMD
-	for (i = 0; i  sizeof(sigs) / sizeof(sigs[0]); i++) {
-		struct sigaction sa;
+#ifdef IN_RCMD
+	if (!relay_signal)
+#endif
+		for (i = 0; i  sizeof(sigs) / sizeof(sigs[0]); i++) {
+			struct sigaction sa;
 
-		if (sa.sa_handler != SIG_IGN) {
-			sa.sa_handler = sendsig;
-			(void)sigaction(sigs[i], sa, NULL);
+			if (sa.sa_handler != SIG_IGN) {
+sa.sa_handler = sendsig;
+(void)sigaction(sigs[i], sa, NULL);
+			}
 		}
-	}
-#endif
 
 	if (!nflag) {
 		pid = fork();
@@ -390,17 +392,18 @@ done:
 		exit(0);
 	}
 
-#ifdef IN_RCMD
-	fdp = fds[0];
-	nfds = 3;
-	fds[0].events = POLLIN|POLLNVAL|POLLERR|POLLHUP;
-	fds[0].fd = 2;
-#else
-	(void)sigprocmask(SIG_SETMASK, oset, NULL);
 	fdp = fds[1];
 	nfds = 2;
 	fds[0].events = 0;
+#ifdef IN_RCMD
+	if (relay_signal) {
+		fdp = fds[0];
+		nfds = 3;
+		fds[0].events = POLLIN|POLLNVAL|POLLERR|POLLHUP;
+		fds[0].fd = 2;
+	} else
 #endif
+		

CVS commit: src/distrib/sets/lists/modules

2014-11-11 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Nov 12 03:48:30 UTC 2014

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Add compatmodules keyword so that build.sh -V MKCOMPATMODULES=no won't fail.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.50 -r1.51 src/distrib/sets/lists/modules/md.i386

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.47 src/distrib/sets/lists/modules/md.amd64:1.48
--- src/distrib/sets/lists/modules/md.amd64:1.47	Tue Nov 11 11:23:25 2014
+++ src/distrib/sets/lists/modules/md.amd64	Wed Nov 12 03:48:30 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.47 2014/11/11 11:23:25 nonaka Exp $
+# $NetBSD: md.amd64,v 1.48 2014/11/12 03:48:30 enami Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -260,12 +260,12 @@
 ./stand/amd64-xen/@OSRELEASE@/modules/dm/dm.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/drmbase-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/drm/drm.kmod			base-kernel-modules	kmod,compatmodules
-./stand/amd64-xen/@OSRELEASE@/modules/drmkmsbase-kernel-modules	kmod
-./stand/amd64-xen/@OSRELEASE@/modules/drmkms/drmkms.kmod		base-kernel-modules	kmod
-./stand/amd64-xen/@OSRELEASE@/modules/drmkms_linux			base-kernel-modules	kmod
-./stand/amd64-xen/@OSRELEASE@/modules/drmkms_linux/drmkms_linux.kmod	base-kernel-modules	kmod
-./stand/amd64-xen/@OSRELEASE@/modules/drmkms_pci			base-kernel-modules	kmod
-./stand/amd64-xen/@OSRELEASE@/modules/drmkms_pci/drmkms_pci.kmod	base-kernel-modules	kmod
+./stand/amd64-xen/@OSRELEASE@/modules/drmkmsbase-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/drmkms/drmkms.kmod		base-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/drmkms_linux			base-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/drmkms_linux/drmkms_linux.kmod	base-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/drmkms_pci			base-kernel-modules	kmod,compatmodules
+./stand/amd64-xen/@OSRELEASE@/modules/drmkms_pci/drmkms_pci.kmod	base-kernel-modules	kmod,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/dtracebase-kernel-modules	kmod,dtrace,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/dtrace/dtrace.kmod		base-kernel-modules	kmod,dtrace,compatmodules
 ./stand/amd64-xen/@OSRELEASE@/modules/dtrace_fbt			base-kernel-modules	kmod,dtrace,compatmodules

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.50 src/distrib/sets/lists/modules/md.i386:1.51
--- src/distrib/sets/lists/modules/md.i386:1.50	Tue Nov 11 11:23:25 2014
+++ src/distrib/sets/lists/modules/md.i386	Wed Nov 12 03:48:30 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.50 2014/11/11 11:23:25 nonaka Exp $
+# $NetBSD: md.i386,v 1.51 2014/11/12 03:48:30 enami Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -288,12 +288,12 @@
 ./stand/i386-xen/@OSRELEASE@/modules/dm/dm.kmodbase-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/drmbase-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/drm/drm.kmod			base-kernel-modules	kmod,compatmodules
-./stand/i386-xen/@OSRELEASE@/modules/drmkms	base-kernel-modules	kmod
-./stand/i386-xen/@OSRELEASE@/modules/drmkms/drmkms.kmodbase-kernel-modules	kmod
-./stand/i386-xen/@OSRELEASE@/modules/drmkms_linuxbase-kernel-modules	kmod
-./stand/i386-xen/@OSRELEASE@/modules/drmkms_linux/drmkms_linux.kmod		base-kernel-modules	kmod
-./stand/i386-xen/@OSRELEASE@/modules/drmkms_pci	base-kernel-modules	kmod
-./stand/i386-xen/@OSRELEASE@/modules/drmkms_pci/drmkms_pci.kmod			base-kernel-modules	kmod
+./stand/i386-xen/@OSRELEASE@/modules/drmkmsbase-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/drmkms/drmkms.kmod			base-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/drmkms_linux			base-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/drmkms_linux/drmkms_linux.kmod	base-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/drmkms_pcibase-kernel-modules	kmod,compatmodules
+./stand/i386-xen/@OSRELEASE@/modules/drmkms_pci/drmkms_pci.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/dtvbase-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/dtv/dtv.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/i386-xen/@OSRELEASE@/modules/dtv_mathbase-kernel-modules	kmod,compatmodules
@@ -677,12 +677,12 @@
 ./stand/i386pae-xen/@OSRELEASE@/modules/dm/dm.kmod			base-kernel-modules	kmod,compatmodules
 

CVS commit: src/distrib/sets

2014-11-11 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Nov 12 03:49:26 UTC 2014

Modified Files:
src/distrib/sets: sets.subr

Log Message:
List missing compatmodules keyword in the comment.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/distrib/sets/sets.subr

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.160 src/distrib/sets/sets.subr:1.161
--- src/distrib/sets/sets.subr:1.160	Wed Jan 29 22:35:52 2014
+++ src/distrib/sets/sets.subr	Wed Nov 12 03:49:26 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.160 2014/01/29 22:35:52 joerg Exp $
+#	$NetBSD: sets.subr,v 1.161 2014/11/12 03:49:26 enami Exp $
 #
 
 #
@@ -179,7 +179,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.160 2014/01/29 22:35:52 joerg Exp $
+# 	# $NetBSD: sets.subr,v 1.161 2014/11/12 03:49:26 enami Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -205,6 +205,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 #	bsdgrep			${MKBSDGREP} != no
 #	catpages		${MKCATPAGES} != no
 #	compat			${MKCOMPAT} != no
+#	compatmodules		${MKCOMPATMODULES} != no
 #	crypto			${MKCRYPTO} != no
 #	crypto_rc5		${MKCRYPTO_RC5} != no
 #	cvs			${MKCVS} != no



CVS commit: src/usr.bin/netstat

2014-10-11 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sat Oct 11 06:25:32 UTC 2014

Modified Files:
src/usr.bin/netstat: netstat.1

Log Message:
- Explicitly describe that kvm(3) is used when -M/-N option is used since
  nowadays sysctl(3) is the default information retrieval method.
- Fix description about default value for -N; it is no longer a single value
  these days, so just say see kvm_openfiles(3) rahter than repeating
  several lines description here.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/netstat/netstat.1

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/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.68 src/usr.bin/netstat/netstat.1:1.69
--- src/usr.bin/netstat/netstat.1:1.68	Thu Oct  9 23:52:47 2014
+++ src/usr.bin/netstat/netstat.1	Sat Oct 11 06:25:32 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: netstat.1,v 1.68 2014/10/09 23:52:47 enami Exp $
+.\	$NetBSD: netstat.1,v 1.69 2014/10/11 06:25:32 enami Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1992, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -223,15 +223,36 @@ and
 .Qq Group
 columns.
 .It Fl M
-Extract values associated with the name list from the specified core
-instead of the default
-.Pa /dev/mem .
+Use
+.Xr kvm 3
+instead of
+.Xr sysctl 3
+to retrieve information and
+extract values associated with the name list from the specified core.
+If
+.Fl M
+option is not given but
+.Fl N
+option is given, the default
+.Pa /dev/mem
+is used.
 .It Fl m
 Show statistics recorded by the mbuf memory management routines
 (the network manages a private pool of memory buffers).
 .It Fl N
-Extract the name list from the specified system instead of the default
-.Pa /netbsd .
+Use
+.Xr kvm 3
+instead of
+.Xr sysctl 3
+to retrieve information and extract the name list from the specified system.
+For the default behavior when only
+.Fl M
+option is given, see the description about when
+.Fa execfile
+is
+.Dv NULL
+in
+.Xr kvm_openfiles 3 .
 .It Fl n
 Show network addresses and ports as numbers (normally
 .Nm



CVS commit: src/usr.bin/netstat

2014-10-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Oct  9 23:45:47 UTC 2014

Modified Files:
src/usr.bin/netstat: main.c

Log Message:
Fix a bug introduced in rev. 1.62; it fails to negate (a  b).


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/netstat/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/usr.bin/netstat/main.c
diff -u src/usr.bin/netstat/main.c:1.91 src/usr.bin/netstat/main.c:1.92
--- src/usr.bin/netstat/main.c:1.91	Fri May 30 01:44:21 2014
+++ src/usr.bin/netstat/main.c	Thu Oct  9 23:45:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $	*/
+/*	$NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = from: @(#)main.c	8.4 (Berkeley) 3/1/94;
 #else
-__RCSID($NetBSD: main.c,v 1.91 2014/05/30 01:44:21 rmind Exp $);
+__RCSID($NetBSD: main.c,v 1.92 2014/10/09 23:45:47 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -344,12 +344,17 @@ prepare(const char *nf, const char *mf, 
 	/*
 	 * Try to figure out if we can use sysctl or not.
 	 */
-	if (nf != NULL  mf != NULL) {
+	if (nf != NULL || mf != NULL) {
 		/* Of course, we can't use sysctl with dumps. */
 		if (force_sysctl)
 			errx(EXIT_FAILURE, can't use sysctl with dumps);
 
-		/* If we have -M and -N, we're not dealing with live memory. */
+		/*
+		 * If we have -M or -N, we're not dealing with live memory
+		 * or want to use kvm interface explicitly.  It is sometimes
+		 * useful to dig inside of kernel without extending
+		 * sysctl interface (i.e., without rebuilding kernel).
+		 */
 		use_sysctl = 0;
 	} else if (qflag ||
 		   iflag ||



CVS commit: src/usr.bin/netstat

2014-10-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Oct  9 23:52:47 UTC 2014

Modified Files:
src/usr.bin/netstat: netstat.1

Log Message:
As described in kvm_openfiles(3), default core file is not /dev/kmem
but /dev/mem.  Actually, passing /dev/kmem to -M doesn't work.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/netstat/netstat.1

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/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.67 src/usr.bin/netstat/netstat.1:1.68
--- src/usr.bin/netstat/netstat.1:1.67	Fri Oct 18 22:18:14 2013
+++ src/usr.bin/netstat/netstat.1	Thu Oct  9 23:52:47 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: netstat.1,v 1.67 2013/10/18 22:18:14 bad Exp $
+.\	$NetBSD: netstat.1,v 1.68 2014/10/09 23:52:47 enami Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1992, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -225,7 +225,7 @@ columns.
 .It Fl M
 Extract values associated with the name list from the specified core
 instead of the default
-.Pa /dev/kmem .
+.Pa /dev/mem .
 .It Fl m
 Show statistics recorded by the mbuf memory management routines
 (the network manages a private pool of memory buffers).
@@ -443,10 +443,10 @@ command appeared in
 .Bx 4.2 .
 IPv6 support was added by WIDE/KAME project.
 .\ .Sh FILES
-.\ .Bl -tag -width /dev/kmem -compact
+.\ .Bl -tag -width /dev/mem -compact
 .\ .It Pa /netbsd
 .\ default kernel namelist
-.\ .It Pa /dev/kmem
+.\ .It Pa /dev/mem
 .\ default memory file
 .\ .El
 .Sh BUGS



CVS commit: src/lib/libperfuse

2014-09-03 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Sep  3 23:59:58 UTC 2014

Modified Files:
src/lib/libperfuse: ops.c perfuse_priv.h

Log Message:
Fix build failure on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.34 -r1.35 src/lib/libperfuse/perfuse_priv.h

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.71 src/lib/libperfuse/ops.c:1.72
--- src/lib/libperfuse/ops.c:1.71	Wed Sep  3 16:01:45 2014
+++ src/lib/libperfuse/ops.c	Wed Sep  3 23:59:58 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.71 2014/09/03 16:01:45 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.72 2014/09/03 23:59:58 enami Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2888,7 +2888,7 @@ perfuse_node_print(struct puffs_usermoun
 
 int
 perfuse_node_pathconf(struct puffs_usermount *pu, puffs_cookie_t opc,
-	int name, int *retval)
+	int name, register_t *retval)
 {
 	perfuse_msg_t *pm;
 	struct perfuse_state *ps;

Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.34 src/lib/libperfuse/perfuse_priv.h:1.35
--- src/lib/libperfuse/perfuse_priv.h:1.34	Sat Aug 16 16:31:15 2014
+++ src/lib/libperfuse/perfuse_priv.h	Wed Sep  3 23:59:58 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.34 2014/08/16 16:31:15 manu Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.35 2014/09/03 23:59:58 enami Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -249,7 +249,7 @@ int perfuse_node_reclaim(struct puffs_us
 int perfuse_node_inactive(struct puffs_usermount *, puffs_cookie_t);
 int perfuse_node_print(struct puffs_usermount *, puffs_cookie_t);
 int perfuse_node_pathconf(struct puffs_usermount *,
-puffs_cookie_t, int, int *);
+puffs_cookie_t, int, register_t *);
 int perfuse_node_advlock(struct puffs_usermount *,
 puffs_cookie_t, void *, int, struct flock *, int);
 int perfuse_node_read(struct puffs_usermount *, puffs_cookie_t,



CVS commit: src/usr.bin/rsh

2014-06-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sun Jun  8 01:44:52 UTC 2014

Modified Files:
src/usr.bin/rsh: rsh.c

Log Message:
Remove kerberos support code completely.  It no longer compiles anyway.
OK'ed by christos on tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/rsh/rsh.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/rsh/rsh.c
diff -u src/usr.bin/rsh/rsh.c:1.33 src/usr.bin/rsh/rsh.c:1.34
--- src/usr.bin/rsh/rsh.c:1.33	Mon Aug 29 14:22:46 2011
+++ src/usr.bin/rsh/rsh.c	Sun Jun  8 01:44:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rsh.c,v 1.33 2011/08/29 14:22:46 joerg Exp $	*/
+/*	$NetBSD: rsh.c,v 1.34 2014/06/08 01:44:52 enami Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1990, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)rsh.c	8.4 (Berkeley) 4/29/95;
 #else
-__RCSID($NetBSD: rsh.c,v 1.33 2011/08/29 14:22:46 joerg Exp $);
+__RCSID($NetBSD: rsh.c,v 1.34 2014/06/08 01:44:52 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -282,13 +282,8 @@ main(int argc, char **argv)
 	else
 		pid = -1;
 
-#if defined(KERBEROS)  defined(CRYPT)
-	if (!doencrypt)
-#endif
-	{
-		(void)ioctl(remerr, FIONBIO, one);
-		(void)ioctl(rem, FIONBIO, one);
-	}
+	(void)ioctl(remerr, FIONBIO, one);
+	(void)ioctl(rem, FIONBIO, one);
 
 	talk(nflag, oset, pid, rem);
 
@@ -310,12 +305,7 @@ checkfd(struct pollfd *fdp, int outfd)
 		return 0;
 
 	errno = 0;
-#if defined(KERBEROS)  defined(CRYPT)
-	if (doencrypt)
-		nr = des_read(fdp-fd, buf, sizeof buf);
-	else
-#endif
-		nr = read(fdp-fd, buf, sizeof buf);
+	nr = read(fdp-fd, buf, sizeof buf);
 
 	if (nr = 0) {
 		if (errno != EAGAIN)
@@ -380,12 +370,7 @@ rewrite:		if (poll(fdp, 1, INFTIM) == -1
 			if ((fdp-revents  POLLOUT) == 0)
 goto rewrite;
 
-#if defined(KERBEROS)  defined(CRYPT)
-			if (doencrypt)
-nw = des_write(rem, bp, nr);
-			else
-#endif
-nw = write(rem, bp, nr);
+			nw = write(rem, bp, nr);
 
 			if (nw  0) {
 if (errno == EAGAIN)



CVS commit: src/usr.bin/rsh

2014-06-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sun Jun  8 02:02:41 UTC 2014

Modified Files:
src/usr.bin/rsh: rsh.c

Log Message:
Whitespace nits.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/rsh/rsh.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/rsh/rsh.c
diff -u src/usr.bin/rsh/rsh.c:1.34 src/usr.bin/rsh/rsh.c:1.35
--- src/usr.bin/rsh/rsh.c:1.34	Sun Jun  8 01:44:52 2014
+++ src/usr.bin/rsh/rsh.c	Sun Jun  8 02:02:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rsh.c,v 1.34 2014/06/08 01:44:52 enami Exp $	*/
+/*	$NetBSD: rsh.c,v 1.35 2014/06/08 02:02:41 enami Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1990, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)rsh.c	8.4 (Berkeley) 4/29/95;
 #else
-__RCSID($NetBSD: rsh.c,v 1.34 2014/06/08 01:44:52 enami Exp $);
+__RCSID($NetBSD: rsh.c,v 1.35 2014/06/08 02:02:41 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -300,7 +300,7 @@ checkfd(struct pollfd *fdp, int outfd)
 
 	if (fdp-revents  (POLLNVAL|POLLERR|POLLHUP))
 		return -1;
-	   
+
 	if ((fdp-revents  POLLIN) == 0)
 		return 0;
 
@@ -416,7 +416,7 @@ sendsig(int sig)
 	char signo;
 
 	signo = sig;
-		(void)write(remerr, signo, 1);
+	(void)write(remerr, signo, 1);
 }
 
 



CVS commit: src/usr.bin/rsh

2014-06-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sun Jun  8 02:44:15 UTC 2014

Modified Files:
src/usr.bin/rsh: rsh.c

Log Message:
Fix signal delivery to remote process; As described in rcmd(3), a signal
is delivered to the remote process via the secondary channel.  So,
the backend driver, rcmd(1), is responsible to watch the file descriptor 2
and transfer the data to the remote process, rather than receiving signal
by itself.  Previously, signal generated by tty was sent since rcmd was
incorrectly generated the data, but, for example, signal sent to rsh command
by kill command was ignored.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/rsh/rsh.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/rsh/rsh.c
diff -u src/usr.bin/rsh/rsh.c:1.35 src/usr.bin/rsh/rsh.c:1.36
--- src/usr.bin/rsh/rsh.c:1.35	Sun Jun  8 02:02:41 2014
+++ src/usr.bin/rsh/rsh.c	Sun Jun  8 02:44:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rsh.c,v 1.35 2014/06/08 02:02:41 enami Exp $	*/
+/*	$NetBSD: rsh.c,v 1.36 2014/06/08 02:44:15 enami Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1990, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)rsh.c	8.4 (Berkeley) 4/29/95;
 #else
-__RCSID($NetBSD: rsh.c,v 1.35 2014/06/08 02:02:41 enami Exp $);
+__RCSID($NetBSD: rsh.c,v 1.36 2014/06/08 02:44:15 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -76,7 +76,9 @@ int	remerr;
 static int sigs[] = { SIGINT, SIGTERM, SIGQUIT };
 
 static char   *copyargs(char **);
+#ifndef IN_RCMD
 static void	sendsig(int);
+#endif
 static int	checkfd(struct pollfd *, int);
 static void	talk(int, sigset_t *, pid_t, int);
 __dead static void	usage(void);
@@ -265,6 +267,7 @@ main(int argc, char **argv)
 
 	(void)sigprocmask(SIG_BLOCK, nset, oset);
 
+#ifndef IN_RCMD
 	for (i = 0; i  sizeof(sigs) / sizeof(sigs[0]); i++) {
 		struct sigaction sa;
 
@@ -273,6 +276,7 @@ main(int argc, char **argv)
 			(void)sigaction(sigs[i], sa, NULL);
 		}
 	}
+#endif
 
 	if (!nflag) {
 		pid = fork();
@@ -329,7 +333,7 @@ static void
 talk(int nflag, sigset_t *oset, __pid_t pid, int rem)
 {
 	int nr, nw, nfds;
-	struct pollfd fds[2], *fdp = fds[0];
+	struct pollfd fds[3], *fdp = fds[0];
 	char *bp, buf[BUFSIZ];
 
 	if (!nflag  pid == 0) {
@@ -385,31 +389,48 @@ done:
 		exit(0);
 	}
 
-	(void)sigprocmask(SIG_SETMASK, oset, NULL);
-	fds[0].events = fds[1].events = POLLIN|POLLNVAL|POLLERR|POLLHUP;
-	fds[0].fd = remerr;
-	fds[1].fd = rem;
+#ifdef IN_RCMD
 	fdp = fds[0];
+	nfds = 3;
+	fds[0].events = POLLIN|POLLNVAL|POLLERR|POLLHUP;
+	fds[0].fd = 2;
+#else
+	(void)sigprocmask(SIG_SETMASK, oset, NULL);
+	fdp = fds[1];
 	nfds = 2;
+	fds[0].events = 0;
+#endif
+	fds[1].events = fds[2].events = POLLIN|POLLNVAL|POLLERR|POLLHUP;
+	fds[1].fd = remerr;
+	fds[2].fd = rem;
 	do {
 		if (poll(fdp, nfds, INFTIM) == -1) {
 			if (errno != EINTR)
 err(1, poll);
 			continue;
 		}
-		if (fds[0].events != 0  checkfd(fds[0], 2) == -1) {
+		if ((fds[1].events != 0  checkfd(fds[1], 2) == -1)
+#ifdef IN_RCMD
+		|| (fds[0].events != 0  checkfd(fds[0], remerr) == -1)
+#endif
+		) {
+			nfds--;
+			fds[1].events = 0;
+#ifdef IN_RCMD
 			nfds--;
 			fds[0].events = 0;
-			fdp = fds[1];
+#endif
+			fdp = fds[2];
 		}
-		if (fds[1].events != 0  checkfd(fds[1], 1) == -1) {
+		if (fds[2].events != 0  checkfd(fds[2], 1) == -1) {
 			nfds--;
-			fds[1].events = 0;
+			fds[2].events = 0;
 		}
 	}
 	while (nfds);
 }
 
+#ifndef IN_RCMD
 static void
 sendsig(int sig)
 {
@@ -418,6 +439,7 @@ sendsig(int sig)
 	signo = sig;
 	(void)write(remerr, signo, 1);
 }
+#endif
 
 
 static char *



CVS commit: src/lib/libc/gen

2013-05-23 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri May 24 03:20:18 UTC 2013

Modified Files:
src/lib/libc/gen: realpath.3

Log Message:
Update ERRORS section:
- Remove some system calls from the list of functions which may set errno
  during the execution of realpath(3) since they are no longer used
  to implement it.
- Document some errno set by the realpath(3) itself.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/gen/realpath.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/libc/gen/realpath.3
diff -u src/lib/libc/gen/realpath.3:1.16 src/lib/libc/gen/realpath.3:1.17
--- src/lib/libc/gen/realpath.3:1.16	Tue Mar  5 03:11:27 2013
+++ src/lib/libc/gen/realpath.3	Fri May 24 03:20:18 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: realpath.3,v 1.16 2013/03/05 03:11:27 enami Exp $
+.\	$NetBSD: realpath.3,v 1.17 2013/05/24 03:20:18 enami Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\ from: @(#)realpath.3	8.2 (Berkeley) 2/16/94
 .\
-.Dd June 21, 2012
+.Dd May 24, 2013
 .Dt REALPATH 3
 .Os
 .Sh NAME
@@ -100,15 +100,34 @@ The function
 may fail and set the external variable
 .Va errno
 for any of the errors specified for the library functions
-.Xr chdir 2 ,
-.Xr close 2 ,
-.Xr fchdir 2 ,
+.\ First sorted by section, then by name.
 .Xr lstat 2 ,
-.Xr malloc 3 ,
-.Xr open 2 ,
-.Xr readlink 2
+.Xr readlink 2 ,
+.Xr getcwd 3
 and
-.Xr getcwd 3 .
+.Xr malloc 3 .
+.Pp
+In addition, the following errors may be reported:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa pathname
+argument is
+.Dv NULL .
+.It Bq Er ELOOP
+Too many symbolic links were encountered in translating the
+.Fa pathname .
+.It Bq Er ENAMETOOLONG
+The resulting absolute pathname exceeds MAXPATHLEN characters.
+.It Bq Er ENOENT
+The value of the
+.Fa pathname
+argument is an empty string.
+.It Bq Er ENOENT
+A symbolic link to an empty string is encountered.
+.It Bq Er ENOTDIR
+A component of the path prefix is not a directory.
+.El
 .Sh SEE ALSO
 .Xr getcwd 3
 .Sh STANDARDS



CVS commit: src/lib/libc/gen

2013-03-04 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Mar  5 03:11:27 UTC 2013

Modified Files:
src/lib/libc/gen: realpath.3

Log Message:
- Refer the argument with correct name.
- Mark up the function as a function like rest of this paragraph does.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/gen/realpath.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/libc/gen/realpath.3
diff -u src/lib/libc/gen/realpath.3:1.15 src/lib/libc/gen/realpath.3:1.16
--- src/lib/libc/gen/realpath.3:1.15	Tue Mar  5 02:46:33 2013
+++ src/lib/libc/gen/realpath.3	Tue Mar  5 03:11:27 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: realpath.3,v 1.15 2013/03/05 02:46:33 soda Exp $
+.\	$NetBSD: realpath.3,v 1.16 2013/03/05 03:11:27 enami Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -75,7 +75,7 @@ and return the absolute pathname corresp
 .Fa pathname .
 .Sh RETURN VALUES
 If
-.Fa resolvednamed
+.Fa resolvedname
 is
 .Dv NULL ,
 it will be allocated and the returned pointer can be deallocated using
@@ -92,7 +92,7 @@ returns
 and
 .Fa resolvedname
 was not allocated by
-.Nm ,
+.Fn realpath ,
 it will contain the pathname which caused the problem.
 .Sh ERRORS
 The function



CVS commit: src/sbin/chown

2012-10-23 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Oct 24 01:12:52 UTC 2012

Modified Files:
src/sbin/chown: chown.c

Log Message:
The id chgrp command is required to change is not uid but gid.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/chown/chown.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/chown/chown.c
diff -u src/sbin/chown/chown.c:1.7 src/sbin/chown/chown.c:1.8
--- src/sbin/chown/chown.c:1.7	Tue Oct 23 17:55:46 2012
+++ src/sbin/chown/chown.c	Wed Oct 24 01:12:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: chown.c,v 1.7 2012/10/23 17:55:46 christos Exp $	*/
+/*	$NetBSD: chown.c,v 1.8 2012/10/24 01:12:51 enami Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994, 2003
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)chown.c	8.8 (Berkeley) 4/4/94;
 #else
-__RCSID($NetBSD: chown.c,v 1.7 2012/10/23 17:55:46 christos Exp $);
+__RCSID($NetBSD: chown.c,v 1.8 2012/10/24 01:12:51 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -181,9 +181,9 @@ main(int argc, char **argv)
 
 		if (stat(reference, st) == -1)
 			err(EXIT_FAILURE, Cannot stat `%s', reference);
-		uid = st.st_uid;
 		if (ischown)
-			gid = st.st_gid;
+			uid = st.st_uid;
+		gid = st.st_gid;
 	}
 
 	if ((ftsp = fts_open(argv, fts_options, NULL)) == NULL)



CVS commit: src/lib/libc/gen

2012-06-21 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 21 23:29:23 UTC 2012

Modified Files:
src/lib/libc/gen: getcwd.c

Log Message:
All error path must go through the free function call after an
allocation of resolved path might succeeded.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/lib/libc/gen/getcwd.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/libc/gen/getcwd.c
diff -u src/lib/libc/gen/getcwd.c:1.52 src/lib/libc/gen/getcwd.c:1.53
--- src/lib/libc/gen/getcwd.c:1.52	Thu Jun 21 21:13:07 2012
+++ src/lib/libc/gen/getcwd.c	Thu Jun 21 23:29:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcwd.c,v 1.52 2012/06/21 21:13:07 christos Exp $	*/
+/*	$NetBSD: getcwd.c,v 1.53 2012/06/21 23:29:23 enami Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1995
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)getcwd.c	8.5 (Berkeley) 2/7/95;
 #else
-__RCSID($NetBSD: getcwd.c,v 1.52 2012/06/21 21:13:07 christos Exp $);
+__RCSID($NetBSD: getcwd.c,v 1.53 2012/06/21 23:29:23 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -183,7 +183,7 @@ loop:
 		}
 		n = readlink(resolved, wbuf[idx], sizeof(wbuf[0]) - 1);
 		if (n  0)
-			return (NULL);
+			goto out;
 		if (n == 0) {
 			errno = ENOENT;
 			goto out;



CVS commit: src/lib/libpthread

2012-04-25 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Apr 26 00:21:44 UTC 2012

Modified Files:
src/lib/libpthread: pthread.c

Log Message:
Store allocated lwpctl state in the thread actually forked,
which is the only thread lives in the child process.

The problem originally reported here:
  https://bugs.ruby-lang.org/issues/6341


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/lib/libpthread/pthread.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/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.133 src/lib/libpthread/pthread.c:1.134
--- src/lib/libpthread/pthread.c:1.133	Thu Mar 22 20:01:18 2012
+++ src/lib/libpthread/pthread.c	Thu Apr 26 00:21:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.133 2012/03/22 20:01:18 drochner Exp $	*/
+/*	$NetBSD: pthread.c,v 1.134 2012/04/26 00:21:44 enami Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread.c,v 1.133 2012/03/22 20:01:18 drochner Exp $);
+__RCSID($NetBSD: pthread.c,v 1.134 2012/04/26 00:21:44 enami Exp $);
 
 #define	__EXPOSE_STACK	1
 
@@ -84,7 +84,6 @@ pthread_queue_t pthread__allqueue;
 
 static pthread_attr_t pthread_default_attr;
 static lwpctl_t pthread__dummy_lwpctl = { .lc_curcpu = LWPCTL_CPU_NONE };
-static pthread_t pthread__first;
 
 enum {
 	DIAGASSERT_ABORT =	10,
@@ -229,7 +228,6 @@ pthread__init(void)
 	}
 
 	/* Tell libc that we're here and it should role-play accordingly. */
-	pthread__first = first;
 	pthread_atfork(NULL, NULL, pthread__fork_callback);
 	__isthreaded = 1;
 }
@@ -237,13 +235,12 @@ pthread__init(void)
 static void
 pthread__fork_callback(void)
 {
-	struct __pthread_st *self;
+	struct __pthread_st *self = pthread__self();
 
 	/* lwpctl state is not copied across fork. */
-	if (_lwp_ctl(LWPCTL_FEATURE_CURCPU, pthread__first-pt_lwpctl)) {
+	if (_lwp_ctl(LWPCTL_FEATURE_CURCPU, self-pt_lwpctl)) {
 		err(1, _lwp_ctl);
 	}
-	self = pthread__self();
 	self-pt_lid = _lwp_self();
 }
 



CVS commit: src/sbin/fdisk

2011-12-01 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Dec  2 04:05:20 UTC 2011

Modified Files:
src/sbin/fdisk: fdisk.c

Log Message:
Add missing -F flag and -I flag in usage.  Sort the order to match
manpage.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sbin/fdisk/fdisk.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/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.136 src/sbin/fdisk/fdisk.c:1.137
--- src/sbin/fdisk/fdisk.c:1.136	Fri Dec  2 03:04:11 2011
+++ src/sbin/fdisk/fdisk.c	Fri Dec  2 04:05:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: fdisk.c,v 1.136 2011/12/02 03:04:11 christos Exp $);
+__RCSID($NetBSD: fdisk.c,v 1.137 2011/12/02 04:05:20 enami Exp $);
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -604,7 +604,7 @@ usage(void)
 {
 	int indent = 7 + (int)strlen(getprogname()) + 1;
 
-	(void)fprintf(stderr, usage: %s [-afiluvBS] 
+	(void)fprintf(stderr, usage: %s [-aBFfIilSuv] 
 		[-A ptn_alignment[/ptn_0_offset]] \\\n
 		%*s[-b cylinders/heads/sectors] \\\n
 		%*s[-0123 | -E num 



CVS commit: src/sys/lib/libkern

2011-11-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sat Nov 26 13:53:37 UTC 2011

Modified Files:
src/sys/lib/libkern: arc4random.c

Log Message:
Fix white space usage.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/lib/libkern/arc4random.c

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

Modified files:

Index: src/sys/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.23 src/sys/lib/libkern/arc4random.c:1.24
--- src/sys/lib/libkern/arc4random.c:1.23	Sun Nov 20 15:37:31 2011
+++ src/sys/lib/libkern/arc4random.c	Sat Nov 26 13:53:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.23 2011/11/20 15:37:31 para Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.24 2011/11/26 13:53:37 enami Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -160,9 +160,9 @@ arc4_randrekey(void *arg)
 		if (callback_pending) {
 			if (arc4_numbytes  ARC4_HARDMAX) {
 printf(arc4random: WARNING, hit 2^29 bytes, 
-   forcibly rekeying.\n);
+forcibly rekeying.\n);
 r = rnd_extract_data(key, ARC4_KEYBYTES,
-		 RND_EXTRACT_ANY);
+RND_EXTRACT_ANY);
 rndsink_detach(rs);
 callback_pending = 0;
 goto got_entropy;
@@ -195,7 +195,7 @@ got_entropy:
 		rs.cb = arc4_randrekey;
 		rs.arg = rs;
 		rs.len = ARC4_KEYBYTES;
-   	rndsink_attach(rs);
+		rndsink_attach(rs);
 	}
 #endif
 	/*
@@ -282,13 +282,13 @@ arc4_randbyte(void)
 u_int32_t
 arc4random(void)
 {
-int ret;
-u_int8_t *retc;
+	int ret;
+	u_int8_t *retc;
 
-retc = (u_int8_t *)ret;
+	retc = (u_int8_t *)ret;
 
-arc4randbytes(retc, sizeof(u_int32_t));
-return ret;
+	arc4randbytes(retc, sizeof(u_int32_t));
+	return ret;
 }
 
 static inline void
@@ -307,7 +307,7 @@ arc4randbytes(void *p, size_t len)
 	/* Initialize array if needed. */
 	if (!arc4_initialized) {
 		arc4_init();
-/* avoid conditionalizing locking */
+		/* avoid conditionalizing locking */
 		return arc4randbytes_unlocked(p, len);
 	}
 	mutex_spin_enter(arc4_mtx);



CVS commit: src/sys/lib/libkern

2011-11-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sat Nov 26 14:04:20 UTC 2011

Modified Files:
src/sys/lib/libkern: arc4random.c

Log Message:
Use exact 32bit integral type to declare variable to store
32bit random value.  This is necessary since it is overwritten
by four bytes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/lib/libkern/arc4random.c

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

Modified files:

Index: src/sys/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.24 src/sys/lib/libkern/arc4random.c:1.25
--- src/sys/lib/libkern/arc4random.c:1.24	Sat Nov 26 13:53:37 2011
+++ src/sys/lib/libkern/arc4random.c	Sat Nov 26 14:04:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.24 2011/11/26 13:53:37 enami Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.25 2011/11/26 14:04:20 enami Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -282,7 +282,7 @@ arc4_randbyte(void)
 u_int32_t
 arc4random(void)
 {
-	int ret;
+	u_int32_t ret;
 	u_int8_t *retc;
 
 	retc = (u_int8_t *)ret;



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

2011-11-16 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Nov 17 02:41:55 UTC 2011

Modified Files:
src/external/bsd/tcpdump/dist: tcpdump.1.in

Log Message:
Replace section number with actual one as we did in see also list.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tcpdump/dist/tcpdump.1.in

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/tcpdump/dist/tcpdump.1.in
diff -u src/external/bsd/tcpdump/dist/tcpdump.1.in:1.4 src/external/bsd/tcpdump/dist/tcpdump.1.in:1.5
--- src/external/bsd/tcpdump/dist/tcpdump.1.in:1.4	Fri Dec 17 10:35:10 2010
+++ src/external/bsd/tcpdump/dist/tcpdump.1.in	Thu Nov 17 02:41:55 2011
@@ -1,6 +1,6 @@
 .\ @(#) Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp (LBL)
 .\
-.\	$NetBSD: tcpdump.1.in,v 1.4 2010/12/17 10:35:10 wiz Exp $
+.\	$NetBSD: tcpdump.1.in,v 1.5 2011/11/17 02:41:55 enami Exp $
 .\
 .\ Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
 .\	The Regents of the University of California.  All rights reserved.
@@ -184,7 +184,7 @@ and will continue capturing packets.
 .LP
 Reading packets from a network interface may require that you have
 special privileges; see the
-.B pcap (3PCAP)
+.B pcap (3)
 man page for details.  Reading a saved packet file doesn't require
 special privileges.
 .SH OPTIONS
@@ -539,7 +539,7 @@ them out.
 They can later be printed with the \-r option.
 Standard output is used if \fIfile\fR is ``-''.
 See
-.BR pcap-savefile (@MAN_FILE_FORMATS@)
+.BR pcap-savefile (5)
 for a description of the file format.
 .TP
 .B \-W
@@ -638,7 +638,7 @@ Otherwise,
 only packets for which \fIexpression\fP is `true' will be dumped.
 .LP
 For the \fIexpression\fP syntax, see
-.BR pcap-filter (@MAN_MISC_INFO@).
+.BR pcap-filter (7).
 .LP
 Expression arguments can be passed to \fItcpdump\fP as either a single
 argument or as multiple arguments, whichever is more convenient.



CVS commit: src/bin/df

2011-08-28 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug 29 00:36:20 UTC 2011

Modified Files:
src/bin/df: df.c

Log Message:
No need to print internal state once debug is done.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.87 src/bin/df/df.c:1.88
--- src/bin/df/df.c:1.87	Sun Aug 28 08:20:58 2011
+++ src/bin/df/df.c	Mon Aug 29 00:36:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $ */
+/*	$NetBSD: df.c,v 1.88 2011/08/29 00:36:20 enami Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@
 #if 0
 static char sccsid[] = @(#)df.c	8.7 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: df.c,v 1.87 2011/08/28 08:20:58 christos Exp $);
+__RCSID($NetBSD: df.c,v 1.88 2011/08/29 00:36:20 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -448,7 +448,6 @@
 			(void)printf(Filesystem %s Used Available Capacity 
 			Mounted on\n, header);
 		} else {
-			printf(%d %d\n, maxwidth, headerlen);
 			(void)printf(%-*.*s %s   Used  Avail %%Cap,
 			maxwidth - (headerlen - 10),
 			maxwidth - (headerlen - 10),



CVS commit: src/sys/kern

2011-08-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug 22 22:09:07 UTC 2011

Modified Files:
src/sys/kern: vfs_syscalls.c

Log Message:
When both nanoseconds fields of futimens/utimensat call are set
to UTIMES_NOW, act as if NULL is passed to second argument, i.e.,
do same permission check and set exactly same value to both access
and modification time.


To generate a diff of this commit:
cvs rdiff -u -r1.437 -r1.438 src/sys/kern/vfs_syscalls.c

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

Modified files:

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.437 src/sys/kern/vfs_syscalls.c:1.438
--- src/sys/kern/vfs_syscalls.c:1.437	Thu Aug 18 19:34:47 2011
+++ src/sys/kern/vfs_syscalls.c	Mon Aug 22 22:09:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.437 2011/08/18 19:34:47 manu Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.437 2011/08/18 19:34:47 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_fileassoc.h
@@ -3137,10 +3137,13 @@
 		}
 	}
 
-	if (ts[0].tv_nsec == UTIME_NOW)
+	if (ts[0].tv_nsec == UTIME_NOW) {
 		nanotime(ts[0]);
-
-	if (ts[1].tv_nsec == UTIME_NOW)
+		if (ts[1].tv_nsec == UTIME_NOW) {
+			vanull = true;
+			ts[1] = ts[0];
+		}
+	} else if (ts[1].tv_nsec == UTIME_NOW)
 		nanotime(ts[1]);
 
 	if (vp == NULL) {



CVS commit: src/sys/kern

2011-08-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug 22 22:12:34 UTC 2011

Modified Files:
src/sys/kern: vfs_syscalls.c

Log Message:
Remove return statement which can't be reached.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/sys/kern/vfs_syscalls.c

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

Modified files:

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.438 src/sys/kern/vfs_syscalls.c:1.439
--- src/sys/kern/vfs_syscalls.c:1.438	Mon Aug 22 22:09:07 2011
+++ src/sys/kern/vfs_syscalls.c	Mon Aug 22 22:12:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.439 2011/08/22 22:12:34 enami Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.438 2011/08/22 22:09:07 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls.c,v 1.439 2011/08/22 22:12:34 enami Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_fileassoc.h
@@ -3092,8 +3092,6 @@
 
 	return do_sys_utimens(l, NULL, SCARG(uap, path), follow,
 	tptr, UIO_USERSPACE);
-
-	return ENOSYS;
 }
 
 /*



CVS commit: src/lib/libc/sys

2011-08-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug 22 22:14:46 UTC 2011

Modified Files:
src/lib/libc/sys: utimes.2

Log Message:
Fix the name of syscall which takes timespec as argument.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/sys/utimes.2

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

Modified files:

Index: src/lib/libc/sys/utimes.2
diff -u src/lib/libc/sys/utimes.2:1.28 src/lib/libc/sys/utimes.2:1.29
--- src/lib/libc/sys/utimes.2:1.28	Wed Aug 17 08:29:20 2011
+++ src/lib/libc/sys/utimes.2	Mon Aug 22 22:14:46 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: utimes.2,v 1.28 2011/08/17 08:29:20 wiz Exp $
+.\	$NetBSD: utimes.2,v 1.29 2011/08/22 22:14:46 enami Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -117,7 +117,7 @@
 the symbolic link's dates are changed.
 .Pp
 The nanosecond fields for
-.Fn futimes
+.Fn futimens
 and
 .Fn utimensat
 can be set to the special value



CVS commit: src/sys/kern

2011-08-08 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Aug  8 06:30:43 UTC 2011

Modified Files:
src/sys/kern: exec_subr.c

Log Message:
Bounds process's stack size with max_stack_size so that 32bit
binary works regardless of stack size limit setting.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/exec_subr.c

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

Modified files:

Index: src/sys/kern/exec_subr.c
diff -u src/sys/kern/exec_subr.c:1.69 src/sys/kern/exec_subr.c:1.70
--- src/sys/kern/exec_subr.c:1.69	Thu Jun 23 23:42:44 2011
+++ src/sys/kern/exec_subr.c	Mon Aug  8 06:30:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $	*/
+/*	$NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: exec_subr.c,v 1.69 2011/06/23 23:42:44 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: exec_subr.c,v 1.70 2011/08/08 06:30:43 enami Exp $);
 
 #include opt_pax.h
 
@@ -404,7 +404,8 @@
 	(unsigned long long)epp-ep_minsaddr,
 	(unsigned long long)max_stack_size));
 
-	epp-ep_ssize = l-l_proc-p_rlimit[RLIMIT_STACK].rlim_cur;
+	epp-ep_ssize = MIN(l-l_proc-p_rlimit[RLIMIT_STACK].rlim_cur,
+	max_stack_size);
 
 #ifdef PAX_ASLR
 	pax_aslr_stack(l, epp, max_stack_size);



CVS commit: src/sys/sys

2011-08-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Aug  3 00:22:05 UTC 2011

Modified Files:
src/sys/sys: exec_elf.h

Log Message:
Replace the word `NetBSD' with `SuSE' in the rest of comments
for the cpp macro constatnt ELF_NOTE_SUSE_*.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/sys/exec_elf.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/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.116 src/sys/sys/exec_elf.h:1.117
--- src/sys/sys/exec_elf.h:1.116	Tue Aug  2 16:44:01 2011
+++ src/sys/sys/exec_elf.h	Wed Aug  3 00:22:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.116 2011/08/02 16:44:01 christos Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.117 2011/08/03 00:22:05 enami Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -808,10 +808,10 @@
  * descsz: 8
  */
 #define	ELF_NOTE_TYPE_SUSE_TAG		0x45537553	/* SuSE in LE */
-/* NetBSD-specific note name and description sizes */
+/* SuSE-specific note name and description sizes */
 #define	ELF_NOTE_SUSE_NAMESZ		8
 #define	ELF_NOTE_SUSE_DESCSZ		8
-/* NetBSD-specific note name */
+/* SuSE-specific note name */
 #define	ELF_NOTE_SUSE_NAME		SuSE\0\0\0\0
 
 /* NetBSD-specific note type: Emulation name.



CVS commit: src/sys/modules

2011-07-19 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Jul 19 23:13:31 UTC 2011

Modified Files:
src/sys/modules: Makefile

Log Message:
Build v7fs module on all architecture rather than only on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.77 src/sys/modules/Makefile:1.78
--- src/sys/modules/Makefile:1.77	Tue Jul 19 19:19:09 2011
+++ src/sys/modules/Makefile	Tue Jul 19 23:13:31 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.77 2011/07/19 19:19:09 tron Exp $
+#	$NetBSD: Makefile,v 1.78 2011/07/19 23:13:31 enami Exp $
 
 .include bsd.own.mk
 
@@ -63,6 +63,7 @@
 SUBDIR+=	umap
 SUBDIR+=	union
 SUBDIR+=	usbverbose
+SUBDIR+=	v7fs
 SUBDIR+=	vnd
 SUBDIR+=	tprof
 .if (defined(NOTYET))
@@ -154,7 +155,6 @@
 SUBDIR+=	viadrm
 SUBDIR+=	pad
 SUBDIR+=	padlock
-SUBDIR+=	v7fs
 SUBDIR+=	viac7temp
 SUBDIR+=	wmieeepc
 .endif



CVS commit: src/sys/fs/tmpfs

2011-06-29 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 30 00:09:27 UTC 2011

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
- Use  PAGE_SHIFT rather than calling round_page again.
- No need to call uao_dropswap_range() here since uao_dropswap()
  is already called for each pages by uvm_vnp_setsize().


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/fs/tmpfs/tmpfs_subr.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.74 src/sys/fs/tmpfs/tmpfs_subr.c:1.75
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.74	Thu Jun 16 09:21:02 2011
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Thu Jun 30 00:09:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.74 2011/06/16 09:21:02 hannken Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $	*/
 
 /*
  * Copyright (c) 2005-2011 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.74 2011/06/16 09:21:02 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $);
 
 #include sys/param.h
 #include sys/dirent.h
@@ -821,7 +821,8 @@
 			return ENOSPC;
 		}
 	} else if (newsize  oldsize) {
-		int zerolen = MIN(round_page(newsize), node-tn_size) - newsize;
+		int zerolen = MIN(newpages  PAGE_SHIFT, node-tn_size)
+		- newsize;
 
 		ubc_zerorange(uobj, newsize, zerolen, UBC_UNMAP_FLAG(vp));
 	}
@@ -830,16 +831,7 @@
 	node-tn_size = newsize;
 	uvm_vnp_setsize(vp, newsize);
 
-	/*
-	 * Free backing store.
-	 */
 	if (newpages  oldpages) {
-		KASSERT(uobj-vmobjlock == vp-v_interlock);
-
-		mutex_enter(uobj-vmobjlock);
-		uao_dropswap_range(uobj, newpages, oldpages);
-		mutex_exit(uobj-vmobjlock);
-
 		/* Decrease the used-memory counter. */
 		tmpfs_mem_decr(tmp, (oldpages - newpages)  PAGE_SHIFT);
 	}



CVS commit: src/sys/fs/tmpfs

2011-06-29 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 30 00:37:08 UTC 2011

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
Backout previous.  May be I need more coffee.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/fs/tmpfs/tmpfs_subr.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.75 src/sys/fs/tmpfs/tmpfs_subr.c:1.76
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.75	Thu Jun 30 00:09:26 2011
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Thu Jun 30 00:37:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.76 2011/06/30 00:37:07 enami Exp $	*/
 
 /*
  * Copyright (c) 2005-2011 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.75 2011/06/30 00:09:26 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_subr.c,v 1.76 2011/06/30 00:37:07 enami Exp $);
 
 #include sys/param.h
 #include sys/dirent.h
@@ -821,8 +821,7 @@
 			return ENOSPC;
 		}
 	} else if (newsize  oldsize) {
-		int zerolen = MIN(newpages  PAGE_SHIFT, node-tn_size)
-		- newsize;
+		int zerolen = MIN(round_page(newsize), node-tn_size) - newsize;
 
 		ubc_zerorange(uobj, newsize, zerolen, UBC_UNMAP_FLAG(vp));
 	}
@@ -831,7 +830,16 @@
 	node-tn_size = newsize;
 	uvm_vnp_setsize(vp, newsize);
 
+	/*
+	 * Free backing store.
+	 */
 	if (newpages  oldpages) {
+		KASSERT(uobj-vmobjlock == vp-v_interlock);
+
+		mutex_enter(uobj-vmobjlock);
+		uao_dropswap_range(uobj, newpages, oldpages);
+		mutex_exit(uobj-vmobjlock);
+
 		/* Decrease the used-memory counter. */
 		tmpfs_mem_decr(tmp, (oldpages - newpages)  PAGE_SHIFT);
 	}



CVS commit: src/sys/netinet

2011-06-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Jun 27 00:45:50 UTC 2011

Modified Files:
src/sys/netinet: ip_reass.c

Log Message:
Don't increment ip_nfragpackets when failed to allocate fragment queue.
No one will decrement it on such case.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/netinet/ip_reass.c

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

Modified files:

Index: src/sys/netinet/ip_reass.c
diff -u src/sys/netinet/ip_reass.c:1.7 src/sys/netinet/ip_reass.c:1.8
--- src/sys/netinet/ip_reass.c:1.7	Fri Nov  5 00:21:51 2010
+++ src/sys/netinet/ip_reass.c	Mon Jun 27 00:45:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.7 2010/11/05 00:21:51 rmind Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.8 2011/06/27 00:45:50 enami Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_reass.c,v 1.7 2010/11/05 00:21:51 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_reass.c,v 1.8 2011/06/27 00:45:50 enami Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -267,11 +267,11 @@
 		else if (ip_nfragpackets = ip_maxfragpackets) {
 			goto dropfrag;
 		}
-		ip_nfragpackets++;
 		fp = malloc(sizeof(ipfr_queue_t), M_FTABLE, M_NOWAIT);
 		if (fp == NULL) {
 			goto dropfrag;
 		}
+		ip_nfragpackets++;
 		TAILQ_INIT(fp-ipq_fragq);
 		fp-ipq_nfrags = 1;
 		fp-ipq_ttl = IPFRAGTTL;



CVS commit: src/usr.sbin/makefs

2011-06-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jun 23 02:35:56 UTC 2011

Modified Files:
src/usr.sbin/makefs: cd9660.h
src/usr.sbin/makefs/cd9660: cd9660_eltorito.c

Log Message:
Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h
since actual user is not cd9660_eltorito.c but iso.h and
cd9660_eltorito.h.

Actually, include order/place of sys/endian.h doesn't matter on
netbsd since it is always included by sys/types.h but it's not
true on other system.  This should fix cross build breakage on
freebsd introduced by rev. 1.16 of cd9660_eltorito.c.
Problem reported and fix suggested on twitter.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/makefs/cd9660.h
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/makefs/cd9660/cd9660_eltorito.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/makefs/cd9660.h
diff -u src/usr.sbin/makefs/cd9660.h:1.16 src/usr.sbin/makefs/cd9660.h:1.17
--- src/usr.sbin/makefs/cd9660.h:1.16	Sun May 22 21:51:39 2011
+++ src/usr.sbin/makefs/cd9660.h	Thu Jun 23 02:35:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660.h,v 1.16 2011/05/22 21:51:39 christos Exp $	*/
+/*	$NetBSD: cd9660.h,v 1.17 2011/06/23 02:35:56 enami Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -51,6 +51,7 @@
 #include limits.h
 #include sys/queue.h
 #include sys/param.h
+#include sys/endian.h
 
 #include makefs.h
 #include iso.h

Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.16 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.17
--- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.16	Mon May 23 00:21:50 2011
+++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Thu Jun 23 02:35:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.c,v 1.16 2011/05/23 00:21:50 christos Exp $	*/
+/*	$NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -36,11 +36,9 @@
 #include cd9660.h
 #include cd9660_eltorito.h
 
-#include sys/endian.h
-
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: cd9660_eltorito.c,v 1.16 2011/05/23 00:21:50 christos Exp $);
+__RCSID($NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $);
 #endif  /* !__lint */
 
 #ifdef DEBUG



CVS commit: src/usr.sbin/syslogd

2011-06-20 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Jun 20 08:27:15 UTC 2011

Modified Files:
src/usr.sbin/syslogd: syslogd.c

Log Message:
Now need to use own buffer for klog read due to previous change.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/usr.sbin/syslogd/syslogd.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/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.103 src/usr.sbin/syslogd/syslogd.c:1.104
--- src/usr.sbin/syslogd/syslogd.c:1.103	Mon Jun 20 00:42:11 2011
+++ src/usr.sbin/syslogd/syslogd.c	Mon Jun 20 08:27:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.103 2011/06/20 00:42:11 enami Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.104 2011/06/20 08:27:15 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)syslogd.c	8.3 (Berkeley) 4/4/94;
 #else
-__RCSID($NetBSD: syslogd.c,v 1.103 2011/06/20 00:42:11 enami Exp $);
+__RCSID($NetBSD: syslogd.c,v 1.104 2011/06/20 08:27:15 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -273,10 +273,11 @@
 
 /*
  * Global line buffer.	Since we only process one event at a time,
- * a global one will do.
+ * a global one will do.  But for klog, we use own buffer so that
+ * partial line at the end of buffer can be deferred.
  */
-char *linebuf;
-size_t linebufsize, linebufoff;
+char *linebuf, *klog_linebuf;
+size_t linebufsize, klog_linebufoff;
 
 static const char *bindhostname = NULL;
 
@@ -457,6 +458,11 @@
 		logerror(Couldn't allocate buffer);
 		die(0, 0, NULL);
 	}
+	if (!(klog_linebuf = malloc(linebufsize))) {
+		logerror(Couldn't allocate buffer for klog);
+		die(0, 0, NULL);
+	}
+
 
 #ifndef SUN_LEN
 #define SUN_LEN(unp) (strlen((unp)-sun_path) + 2)
@@ -662,16 +668,16 @@
 dispatch_read_klog(int fd, short event, void *ev)
 {
 	ssize_t rv;
-	size_t resid = linebufsize - linebufoff;
+	size_t resid = linebufsize - klog_linebufoff;
 
 	DPRINTF((D_CALL|D_EVENT), Kernel log active (%d, %d, %p)
 		 with linebuf@%p, length %zu)\n, fd, event, ev,
-		linebuf, linebufsize);
+		klog_linebuf, linebufsize);
 
-	rv = read(fd, linebuf[linebufoff], resid - 1);
+	rv = read(fd, klog_linebuf[klog_linebufoff], resid - 1);
 	if (rv  0) {
-		linebuf[linebufoff + rv] = '\0';
-		printsys(linebuf);
+		klog_linebuf[klog_linebufoff + rv] = '\0';
+		printsys(klog_linebuf);
 	} else if (rv  0  errno != EINTR) {
 		/*
 		 * /dev/klog has croaked.  Disable the event
@@ -1504,7 +1510,7 @@
 	char *p, *q;
 	struct buf_msg *buffer;
 
-	linebufoff = 0;
+	klog_linebufoff = 0;
 	for (p = msg; *p != '\0'; ) {
 		bool bsdsyslog = true;
 
@@ -1537,7 +1543,7 @@
 		if (*q != '\0')
 			*q++ = '\0';
 		else {
-			memcpy(linebuf, p, linebufoff = q - p);
+			memcpy(linebuf, p, klog_linebufoff = q - p);
 			break;
 		}
 



CVS commit: src/usr.sbin/syslogd

2011-06-19 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Jun 20 00:42:12 UTC 2011

Modified Files:
src/usr.sbin/syslogd: syslogd.c

Log Message:
Defer the processing of incomplete line at the end of buffer so that
kernel printf messages logged to /var/log/messages become always
easier to read.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/usr.sbin/syslogd/syslogd.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/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.102 src/usr.sbin/syslogd/syslogd.c:1.103
--- src/usr.sbin/syslogd/syslogd.c:1.102	Tue May 24 13:26:04 2011
+++ src/usr.sbin/syslogd/syslogd.c	Mon Jun 20 00:42:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.102 2011/05/24 13:26:04 joerg Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.103 2011/06/20 00:42:11 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)syslogd.c	8.3 (Berkeley) 4/4/94;
 #else
-__RCSID($NetBSD: syslogd.c,v 1.102 2011/05/24 13:26:04 joerg Exp $);
+__RCSID($NetBSD: syslogd.c,v 1.103 2011/06/20 00:42:11 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -276,7 +276,7 @@
  * a global one will do.
  */
 char *linebuf;
-size_t linebufsize;
+size_t linebufsize, linebufoff;
 
 static const char *bindhostname = NULL;
 
@@ -662,14 +662,15 @@
 dispatch_read_klog(int fd, short event, void *ev)
 {
 	ssize_t rv;
+	size_t resid = linebufsize - linebufoff;
 
 	DPRINTF((D_CALL|D_EVENT), Kernel log active (%d, %d, %p)
 		 with linebuf@%p, length %zu)\n, fd, event, ev,
 		linebuf, linebufsize);
 
-	rv = read(fd, linebuf, linebufsize - 1);
+	rv = read(fd, linebuf[linebufoff], resid - 1);
 	if (rv  0) {
-		linebuf[rv] = '\0';
+		linebuf[linebufoff + rv] = '\0';
 		printsys(linebuf);
 	} else if (rv  0  errno != EINTR) {
 		/*
@@ -1503,6 +1504,7 @@
 	char *p, *q;
 	struct buf_msg *buffer;
 
+	linebufoff = 0;
 	for (p = msg; *p != '\0'; ) {
 		bool bsdsyslog = true;
 
@@ -1534,6 +1536,10 @@
 			 * trust the kernel to send ASCII only */;
 		if (*q != '\0')
 			*q++ = '\0';
+		else {
+			memcpy(linebuf, p, linebufoff = q - p);
+			break;
+		}
 
 		if (pri ~ (LOG_FACMASK|LOG_PRIMASK))
 			pri = DEFSPRI;



CVS commit: src/usr.bin/mkdep

2011-05-30 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 31 02:34:32 UTC 2011

Modified Files:
src/usr.bin/mkdep: mkdep.c

Log Message:
Don't touch before the mmap'ed region.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/mkdep/mkdep.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/mkdep/mkdep.c
diff -u src/usr.bin/mkdep/mkdep.c:1.37 src/usr.bin/mkdep/mkdep.c:1.38
--- src/usr.bin/mkdep/mkdep.c:1.37	Mon May 30 22:52:12 2011
+++ src/usr.bin/mkdep/mkdep.c	Tue May 31 02:34:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdep.c,v 1.37 2011/05/30 22:52:12 christos Exp $ */
+/* $NetBSD: mkdep.c,v 1.38 2011/05/31 02:34:32 enami Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT(@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\
  All rights reserved.);
-__RCSID($NetBSD: mkdep.c,v 1.37 2011/05/30 22:52:12 christos Exp $);
+__RCSID($NetBSD: mkdep.c,v 1.38 2011/05/31 02:34:32 enami Exp $);
 #endif /* not lint */
 
 #include sys/mman.h
@@ -379,7 +379,7 @@
 /* Then look for any valid suffix */
 for (sl = suff_list; sl != NULL;
 sl = sl-next) {
-	if (sl-len 
+	if (sl-len  buf = suf - sl-len 
 	!memcmp(suf - sl-len, sl-suff,
 		sl-len))
 		break;



CVS commit: src/lib/libc

2011-05-16 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 17 03:35:39 UTC 2011

Modified Files:
src/lib/libc/gen: vis.3
src/lib/libc/regex: regex.3
src/lib/libc/rpc: rpc_clnt_create.3

Log Message:
Use Pq or Po macro for better output rather than putting raw open paren
at the end of line.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/vis.3
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/regex/regex.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/rpc/rpc_clnt_create.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/libc/gen/vis.3
diff -u src/lib/libc/gen/vis.3:1.25 src/lib/libc/gen/vis.3:1.26
--- src/lib/libc/gen/vis.3:1.25	Sun Mar 13 09:12:35 2011
+++ src/lib/libc/gen/vis.3	Tue May 17 03:35:38 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: vis.3,v 1.25 2011/03/13 09:12:35 wiz Exp $
+.\	$NetBSD: vis.3,v 1.26 2011/05/17 03:35:38 enami Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -429,13 +429,13 @@
 .Fn strsvisx
 functions appeared in
 .Nx 1.5 .
-The buffer size limited versions of the functions (
-.Fn nvis ,
+The buffer size limited versions of the functions
+.Po Fn nvis ,
 .Fn strnvis ,
 .Fn strnvisx ,
 .Fn snvis ,
 .Fn strsnvis ,
 and 
-.Fn strsnvisx )
+.Fn strsnvisx Pc
 appeared in
 .Nx 6.0 .

Index: src/lib/libc/regex/regex.3
diff -u src/lib/libc/regex/regex.3:1.21 src/lib/libc/regex/regex.3:1.22
--- src/lib/libc/regex/regex.3:1.21	Mon Mar 22 19:30:54 2010
+++ src/lib/libc/regex/regex.3	Tue May 17 03:35:38 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: regex.3,v 1.21 2010/03/22 19:30:54 joerg Exp $
+.\	$NetBSD: regex.3,v 1.22 2011/05/17 03:35:38 enami Exp $
 .\
 .\ Copyright (c) 1992, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -394,11 +394,11 @@
 it should have been the result from the most recent
 .Fn regcomp
 using that
-.Fa regex_t . (
-.Fn regerror
+.Fa regex_t .
+.Po Fn regerror
 may be able to supply a more detailed message using information
 from the
-.Fa regex_t . )
+.Fa regex_t . Pc
 .Fn regerror
 places the NUL-terminated message into the buffer pointed to by
 .Fa errbuf ,

Index: src/lib/libc/rpc/rpc_clnt_create.3
diff -u src/lib/libc/rpc/rpc_clnt_create.3:1.11 src/lib/libc/rpc/rpc_clnt_create.3:1.12
--- src/lib/libc/rpc/rpc_clnt_create.3:1.11	Sat May 23 18:57:25 2009
+++ src/lib/libc/rpc/rpc_clnt_create.3	Tue May 17 03:35:39 2011
@@ -2,7 +2,7 @@
 .\ Copyright 1989 ATT
 .\ @(#)rpc_clnt_create 1.5 89/07/24 SMI;
 .\ Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
-.\	$NetBSD: rpc_clnt_create.3,v 1.11 2009/05/23 18:57:25 christos Exp $
+.\	$NetBSD: rpc_clnt_create.3,v 1.12 2011/05/17 03:35:39 enami Exp $
 .Dd May 23, 2009
 .Dt RPC_CLNT_CREATE 3
 .Os
@@ -84,8 +84,8 @@
 Note:
 If you set the timeout value to 0
 .Fn clnt_control
-immediately returns an error (
-.Dv RPC_TIMEDOUT ) .
+immediately returns an error
+.Pq Dv RPC_TIMEDOUT .
 Set the timeout parameter to 0 for batching calls.
 .Bl -column CLSET_FD_NCLOSE struct timeval * do not close fd on destroy
 .It Dv CLGET_SVC_ADDR Ta struct netbuf * Ta get servers address



CVS commit: src/share/misc

2011-05-10 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 10 23:33:07 UTC 2011

Modified Files:
src/share/misc: acronyms.comp

Log Message:
According to their home page, N of IANA is plural.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.124 src/share/misc/acronyms.comp:1.125
--- src/share/misc/acronyms.comp:1.124	Sat Mar 26 12:40:07 2011
+++ src/share/misc/acronyms.comp	Tue May 10 23:33:07 2011
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.124 2011/03/26 12:40:07 dholland Exp $
+$NetBSD: acronyms.comp,v 1.125 2011/05/10 23:33:07 enami Exp $
 
 3WHS	three-way handshake
 AA	anti-aliasing
@@ -456,7 +456,7 @@
 HZ	Hertz
 I2O	intelligent input/output
 IA	information assurance
-IANA	Internet assigned number authority
+IANA	Internet assigned numbers authority
 IBC	iterated block cipher
 IBM	International Business Machines
 IBS	instruction based sampling



CVS commit: src/usr.bin/netstat

2011-05-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 10 04:40:16 UTC 2011

Modified Files:
src/usr.bin/netstat: vtw.c

Log Message:
Use ptrdiff_t to hold pointer difference to avoid coredump on LP64 system.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/netstat/vtw.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/netstat/vtw.c
diff -u src/usr.bin/netstat/vtw.c:1.4 src/usr.bin/netstat/vtw.c:1.5
--- src/usr.bin/netstat/vtw.c:1.4	Wed May  4 03:43:30 2011
+++ src/usr.bin/netstat/vtw.c	Tue May 10 04:40:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vtw.c,v 1.4 2011/05/04 03:43:30 pgoyette Exp $	*/
+/*	$NetBSD: vtw.c,v 1.5 2011/05/10 04:40:16 enami Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #if 0
 static char sccsid[] = from: @(#)inet.c	8.4 (Berkeley) 4/20/94;
 #else
-__RCSID($NetBSD: vtw.c,v 1.4 2011/05/04 03:43:30 pgoyette Exp $);
+__RCSID($NetBSD: vtw.c,v 1.5 2011/05/10 04:40:16 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -251,7 +251,7 @@
 	for (i = 0; i  VTW_NCLASS; ++i) {
 		vtw_v4_t *kbase, *klim;
 		vtw_v4_t *ubase, *ulim;
-		int delta;
+		ptrdiff_t delta;
 
 		kbase = vtw_tcpv4[i].base.v4;
 		klim = vtw_tcpv4[i].lim.v4;
@@ -354,7 +354,7 @@
 	for (i = 0; i  VTW_NCLASS; ++i) {
 		vtw_v6_t *kbase, *klim;
 		vtw_v6_t *ubase, *ulim;
-		int delta;
+		ptrdiff_t delta;
 
 		kbase = vtw_tcpv6[i].base.v6;
 		klim = vtw_tcpv6[i].lim.v6;



CVS commit: src/lib/libc/stdio

2011-04-20 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Apr 20 23:37:51 UTC 2011

Modified Files:
src/lib/libc/stdio: getdelim.3

Log Message:
- Put empty line after the local variable definition in the sample code
  to improve readability.
- Remove indirection operator to clarify error condition.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/stdio/getdelim.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/libc/stdio/getdelim.3
diff -u src/lib/libc/stdio/getdelim.3:1.8 src/lib/libc/stdio/getdelim.3:1.9
--- src/lib/libc/stdio/getdelim.3:1.8	Wed Jun 30 13:38:10 2010
+++ src/lib/libc/stdio/getdelim.3	Wed Apr 20 23:37:51 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: getdelim.3,v 1.8 2010/06/30 13:38:10 jruoho Exp $
+.\ $NetBSD: getdelim.3,v 1.9 2011/04/20 23:37:51 enami Exp $
 .\
 .\ Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -108,6 +108,7 @@
 char *line = NULL;
 size_t linesize = 0;
 ssize_t linelen;
+
 while ((linelen = getline(\*[Am]line, \*[Am]linesize, fp)) != -1)
 	fwrite(line, linelen, 1, stdout);
 
@@ -117,9 +118,9 @@
 .Sh ERRORS
 .Bl -tag -width [EOVERFLOW]
 .It Bq Er EINVAL
-.Fa *lineptr
+.Fa lineptr
 or
-.Fa *n
+.Fa n
 is a
 .Dv NULL
 pointer.



CVS commit: src/sys/arch/x86/x86

2011-04-20 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Apr 21 00:24:07 UTC 2011

Modified Files:
src/sys/arch/x86/x86: db_trace.c

Log Message:
lwpaddr is a boolean variable and thus doesn't hold an address of lwp.
Compare with correct value so that tr/t works again on current procecss.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/db_trace.c

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/x86/x86/db_trace.c
diff -u src/sys/arch/x86/x86/db_trace.c:1.2 src/sys/arch/x86/x86/db_trace.c:1.3
--- src/sys/arch/x86/x86/db_trace.c:1.2	Mon Apr 11 04:22:31 2011
+++ src/sys/arch/x86/x86/db_trace.c	Thu Apr 21 00:24:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.2 2011/04/11 04:22:31 mrg Exp $	*/
+/*	$NetBSD: db_trace.c,v 1.3 2011/04/21 00:24:07 enami Exp $	*/
 
 /* 
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.2 2011/04/11 04:22:31 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.3 2011/04/21 00:24:07 enami Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -158,13 +158,13 @@
 return;
 			}
 			db_read_bytes((db_addr_t)pp, sizeof(p), (char *)p);
-			db_read_bytes((db_addr_t)p.p_lwps.lh_first,
-			sizeof(l), (char *)l);
+			addr = (db_addr_t)p.p_lwps.lh_first;
+			db_read_bytes(addr, sizeof(l), (char *)l);
 		}
 		(*pr)(lid %d , l.l_lid);
 		pcb = lwp_getpcb(l);
 #ifdef _KERNEL
-		if (l.l_proc == curproc  (lwp_t *)lwpaddr == curlwp)
+		if (l.l_proc == curproc  (lwp_t *)addr == curlwp)
 			set_frame_callpc();
 		else
 #endif



CVS commit: src/etc/rc.d

2011-04-04 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Apr  5 02:52:28 UTC 2011

Modified Files:
src/etc/rc.d: ccd

Log Message:
Unconfigure on shutdown so that component deivces are closed.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/etc/rc.d/ccd

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.d/ccd
diff -u src/etc/rc.d/ccd:1.6 src/etc/rc.d/ccd:1.7
--- src/etc/rc.d/ccd:1.6	Tue Apr 21 16:08:57 2009
+++ src/etc/rc.d/ccd	Tue Apr  5 02:52:27 2011
@@ -1,17 +1,18 @@
 #!/bin/sh
 #
-# $NetBSD: ccd,v 1.6 2009/04/21 16:08:57 joerg Exp $
+# $NetBSD: ccd,v 1.7 2011/04/05 02:52:27 enami Exp $
 #
 
 # PROVIDE: ccd
 # BEFORE:  DISKS
+# KEYWORD: shutdown
 
 $_rc_subr_loaded . /etc/rc.subr
 
 name=ccd
 rcvar=$name
 start_cmd=ccd_start
-stop_cmd=:
+stop_cmd=ccd_stop
 
 ccd_start()
 {
@@ -21,5 +22,13 @@
 	fi
 }
 
+ccd_stop()
+{
+	if [ -f /etc/ccd.conf ]; then
+		echo Unconfiguring CCD devices.
+		ccdconfig -U
+	fi
+}
+
 load_rc_config $name
 run_rc_command $1



CVS commit: src/lib/libc/gdtoa

2011-03-21 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar 21 23:37:42 UTC 2011

Modified Files:
src/lib/libc/gdtoa: hdtoa.c

Log Message:
Don't use #endif where #else is expected.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/gdtoa/hdtoa.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/libc/gdtoa/hdtoa.c
diff -u src/lib/libc/gdtoa/hdtoa.c:1.7 src/lib/libc/gdtoa/hdtoa.c:1.8
--- src/lib/libc/gdtoa/hdtoa.c:1.7	Mon Mar 21 22:33:46 2011
+++ src/lib/libc/gdtoa/hdtoa.c	Mon Mar 21 23:37:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdtoa.c,v 1.7 2011/03/21 22:33:46 christos Exp $	*/
+/*	$NetBSD: hdtoa.c,v 1.8 2011/03/21 23:37:42 enami Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005 David Schultz d...@freebsd.org
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID($FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.4 2007/01/03 04:57:58 das Exp $);
 #else
-__RCSID($NetBSD: hdtoa.c,v 1.7 2011/03/21 22:33:46 christos Exp $);
+__RCSID($NetBSD: hdtoa.c,v 1.8 2011/03/21 23:37:42 enami Exp $);
 #endif
 
 #include float.h
@@ -165,7 +165,7 @@
 		/* (DBL_MAX_EXP=127 / 2) + 2 = 65? */
 		u.dblu_d *= 0x1p65;
 		*decpt = u.dblu_dbl.dbl_exp - (65 + DBL_ADJ);
-#endif
+#else
 		/* (DBL_MAX_EXP=1024 / 2) + 2 = 514? */
 		u.dblu_d *= 0x1p514;
 		*decpt = u.dblu_dbl.dbl_exp - (514 + DBL_ADJ);



CVS commit: src/tests/fs/ffs/clients

2011-03-06 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar  7 03:29:26 UTC 2011

Modified Files:
src/tests/fs/ffs/clients: Makefile

Log Message:
Fix link error.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/clients/Makefile

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

Modified files:

Index: src/tests/fs/ffs/clients/Makefile
diff -u src/tests/fs/ffs/clients/Makefile:1.2 src/tests/fs/ffs/clients/Makefile:1.3
--- src/tests/fs/ffs/clients/Makefile:1.2	Sun Mar  6 17:08:41 2011
+++ src/tests/fs/ffs/clients/Makefile	Mon Mar  7 03:29:26 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/03/06 17:08:41 bouyer Exp $
+#	$NetBSD: Makefile,v 1.3 2011/03/07 03:29:26 enami Exp $
 #
 
 .include bsd.own.mk
@@ -9,8 +9,9 @@
 PROGS=			rump_quota rump_repquota rump_edquota rump_quotactl
 
 .PATH: ${NETBSDSRCDIR}/usr.bin/quota
-SRCS.rump_quota=	quota.c printquota.c getvfsquota.c quota_rumpops.c 
-SRCS.rump_repquota=	printquota.c quota_rumpops.c
+SRCS.rump_quota=	quota.c printquota.c getvfsquota.c quota_rumpops.c \
+			quotautil.c
+SRCS.rump_repquota=	printquota.c quota_rumpops.c quotautil.c
 SRCS.rump_edquota=	printquota.c getvfsquota.c quota_rumpops.c
 CPPFLAGS.quota.c+=	-I${NETBSDSRCDIR}/usr.bin/quota
 CPPFLAGS.printquota.c+=	-I${NETBSDSRCDIR}/usr.bin/quota
@@ -21,7 +22,7 @@
 CPPFLAGS.repquota.c+=	-I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
 
 .PATH: ${NETBSDSRCDIR}/usr.sbin/edquota
-SRCS.rump_edquota+=	edquota.c
+SRCS.rump_edquota+=	edquota.c quotautil.c
 CPPFLAGS.edquota.c+=	-I${NETBSDSRCDIR}/sys -I${NETBSDSRCDIR}/usr.bin/quota
 
 .PATH: ${NETBSDSRCDIR}/usr.sbin/quotactl



CVS commit: src/sys/net

2011-02-19 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sat Feb 19 08:46:41 UTC 2011

Modified Files:
src/sys/net: bpf_filter.c

Log Message:
Fix userland build.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/net/bpf_filter.c

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

Modified files:

Index: src/sys/net/bpf_filter.c
diff -u src/sys/net/bpf_filter.c:1.44 src/sys/net/bpf_filter.c:1.45
--- src/sys/net/bpf_filter.c:1.44	Sat Feb 19 04:10:47 2011
+++ src/sys/net/bpf_filter.c	Sat Feb 19 08:46:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf_filter.c,v 1.44 2011/02/19 04:10:47 christos Exp $	*/
+/*	$NetBSD: bpf_filter.c,v 1.45 2011/02/19 08:46:41 enami Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.44 2011/02/19 04:10:47 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf_filter.c,v 1.45 2011/02/19 08:46:41 enami Exp $);
 
 #if 0
 #if !(defined(lint) || defined(KERNEL))
@@ -467,9 +467,10 @@
 int
 bpf_validate(const struct bpf_insn *f, int signed_len)
 {
-	u_int i, from, len, ok = 0, size;
+	u_int i, from, len, ok = 0;
 	const struct bpf_insn *p;
 #if defined(KERNEL) || defined(_KERNEL)
+	u_int size;
 	uint16_t *mem, invalid;
 #endif
 



CVS commit: src

2011-02-18 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sat Feb 19 07:11:10 UTC 2011

Modified Files:
src/sbin/raidctl: raidctl.c
src/sys/dev/raidframe: raidframevar.h rf_copyback.c rf_disks.c
rf_netbsdkintf.c rf_reconstruct.c

Log Message:
Define accessors for number of blocks and partition size in the
component label and use them where appropriate.  Disscussed on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/raidctl/raidctl.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/raidframe/raidframevar.h
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/raidframe/rf_copyback.c
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/raidframe/rf_disks.c
cvs rdiff -u -r1.281 -r1.282 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/raidframe/rf_reconstruct.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/raidctl/raidctl.c
diff -u src/sbin/raidctl/raidctl.c:1.51 src/sbin/raidctl/raidctl.c:1.52
--- src/sbin/raidctl/raidctl.c:1.51	Wed Feb  9 11:22:49 2011
+++ src/sbin/raidctl/raidctl.c	Sat Feb 19 07:11:10 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: raidctl.c,v 1.51 2011/02/09 11:22:49 pooka Exp $   */
+/*  $NetBSD: raidctl.c,v 1.52 2011/02/19 07:11:10 enami 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.51 2011/02/09 11:22:49 pooka Exp $);
+__RCSID($NetBSD: raidctl.c,v 1.52 2011/02/19 07:11:10 enami Exp $);
 #endif
 
 
@@ -743,9 +743,9 @@
 	printf(   sectPerSU: %d, SUsPerPU: %d, SUsPerRU: %d\n,
 	   component_label.sectPerSU, component_label.SUsPerPU, 
 	   component_label.SUsPerRU);
-	printf(   Queue size: %d, blocksize: %d, numBlocks: %u\n,
+	printf(   Queue size: %d, blocksize: %d, numBlocks: %PRIu64\n,
 	   component_label.maxOutstanding, component_label.blockSize,
-	   component_label.numBlocks);
+	   rf_component_label_numblocks(component_label));
 	printf(   RAID Level: %c\n, (char) component_label.parityConfig);
 	printf(   Autoconfig: %s\n, 
 	   component_label.autoconfigure ? Yes : No );

Index: src/sys/dev/raidframe/raidframevar.h
diff -u src/sys/dev/raidframe/raidframevar.h:1.14 src/sys/dev/raidframe/raidframevar.h:1.15
--- src/sys/dev/raidframe/raidframevar.h:1.14	Mon Nov  1 02:35:24 2010
+++ src/sys/dev/raidframe/raidframevar.h	Sat Feb 19 07:11:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: raidframevar.h,v 1.14 2010/11/01 02:35:24 mrg Exp $ */
+/*	$NetBSD: raidframevar.h,v 1.15 2011/02/19 07:11:09 enami Exp $ */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -444,9 +444,9 @@
 	int maxOutstanding;   /* maxOutstanding disk requests */
 	int blockSize;/* size of component block.
  (disklabel-d_secsize) */
-	u_int numBlocks;  /* number of blocks on this component.  May
+	u_int __numBlocks;/* number of blocks on this component.  May
 			 be smaller than the partition size. */
-	u_int partitionSize;  /* number of blocks on this *partition*.
+	u_int __partitionSize;/* number of blocks on this *partition*.
  Must exactly match the partition size
  from the disklabel. */
 	/* Parity map stuff. */
@@ -476,6 +476,43 @@
 	int future_use2[42];  /* More future expansion */
 } RF_ComponentLabel_t;
 
+/*
+ * Following four functions are access macros for the number of blocks
+ * and partition size in component label.
+ */
+static inline RF_SectorCount_t
+rf_component_label_numblocks(const RF_ComponentLabel_t *cl)
+{
+
+	return ((RF_SectorCount_t)cl-numBlocksHi  32) |
+	cl-__numBlocks;
+}
+
+static inline void
+rf_component_label_set_numblocks(RF_ComponentLabel_t *cl, RF_SectorCount_t siz)
+{
+
+	cl-numBlocksHi = siz  32;
+	cl-__numBlocks = siz;
+}
+
+static inline RF_SectorCount_t
+rf_component_label_partitionsize(const RF_ComponentLabel_t *cl)
+{
+
+	return ((RF_SectorCount_t)cl-partitionSizeHi  32) |
+	cl-__partitionSize;
+}
+
+static inline void
+rf_component_label_set_partitionsize(RF_ComponentLabel_t *cl,
+RF_SectorCount_t siz)
+{
+
+	cl-partitionSizeHi = siz  32;
+	cl-__partitionSize = siz;
+}
+
 typedef struct RF_SingleComponent_s {
 	int row;
 	int column;

Index: src/sys/dev/raidframe/rf_copyback.c
diff -u src/sys/dev/raidframe/rf_copyback.c:1.44 src/sys/dev/raidframe/rf_copyback.c:1.45
--- src/sys/dev/raidframe/rf_copyback.c:1.44	Fri Nov 19 06:44:40 2010
+++ src/sys/dev/raidframe/rf_copyback.c	Sat Feb 19 07:11:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_copyback.c,v 1.44 2010/11/19 06:44:40 dholland Exp $	*/
+/*	$NetBSD: rf_copyback.c,v 1.45 2011/02/19 07:11:09 enami Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -38,7 +38,7 @@
  /
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_copyback.c,v 1.44 

CVS commit: src/usr.sbin/iostat

2011-02-13 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Feb 14 02:42:26 UTC 2011

Modified Files:
src/usr.sbin/iostat: iostat.c

Log Message:
Put space after comma and around binary operator.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/iostat/iostat.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/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.57 src/usr.sbin/iostat/iostat.c:1.58
--- src/usr.sbin/iostat/iostat.c:1.57	Sun Jan  9 03:35:23 2011
+++ src/usr.sbin/iostat/iostat.c	Mon Feb 14 02:42:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.57 2011/01/09 03:35:23 jakllsch Exp $	*/
+/*	$NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)iostat.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: iostat.c,v 1.57 2011/01/09 03:35:23 jakllsch Exp $);
+__RCSID($NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -327,7 +327,7 @@
 		else
 			mbps = 0.0;
 		(void)printf( %5.*f,
-		MAX(0,3-(int)floor(log10(fabs(fmax(1.0,mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
 
 	/* average transfers per second. */
 		(void)printf( %4.0f,
@@ -345,7 +345,7 @@
 			mbps = 0;
 		mbps /= etime;
 		(void)printf( %5.*f ,
-		MAX(0,3-(int)floor(log10(fabs(fmax(1.0,mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
 	}
 }
 



CVS commit: src/usr.sbin/iostat

2011-02-13 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Feb 14 02:43:37 UTC 2011

Modified Files:
src/usr.sbin/iostat: iostat.c

Log Message:
A number greater than or equal to 1.0 is a positive number.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/iostat/iostat.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/iostat/iostat.c
diff -u src/usr.sbin/iostat/iostat.c:1.58 src/usr.sbin/iostat/iostat.c:1.59
--- src/usr.sbin/iostat/iostat.c:1.58	Mon Feb 14 02:42:26 2011
+++ src/usr.sbin/iostat/iostat.c	Mon Feb 14 02:43:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $	*/
+/*	$NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)iostat.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: iostat.c,v 1.58 2011/02/14 02:42:26 enami Exp $);
+__RCSID($NetBSD: iostat.c,v 1.59 2011/02/14 02:43:37 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -327,7 +327,7 @@
 		else
 			mbps = 0.0;
 		(void)printf( %5.*f,
-		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fmax(1.0, mbps, mbps);
 
 	/* average transfers per second. */
 		(void)printf( %4.0f,
@@ -345,7 +345,7 @@
 			mbps = 0;
 		mbps /= etime;
 		(void)printf( %5.*f ,
-		MAX(0, 3 - (int)floor(log10(fabs(fmax(1.0, mbps), mbps);
+		MAX(0, 3 - (int)floor(log10(fmax(1.0, mbps, mbps);
 	}
 }
 



CVS commit: src/sys/dev/raidframe

2011-02-12 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Sun Feb 13 06:17:36 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_disks.c

Log Message:
Remove one of trailing whitespace which adds unnecessary difference
against netbsd-5 branch.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/raidframe/rf_disks.c

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/raidframe/rf_disks.c
diff -u src/sys/dev/raidframe/rf_disks.c:1.76 src/sys/dev/raidframe/rf_disks.c:1.77
--- src/sys/dev/raidframe/rf_disks.c:1.76	Sat Dec  4 10:01:16 2010
+++ src/sys/dev/raidframe/rf_disks.c	Sun Feb 13 06:17:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_disks.c,v 1.76 2010/12/04 10:01:16 mrg Exp $	*/
+/*	$NetBSD: rf_disks.c,v 1.77 2011/02/13 06:17:35 enami Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,7 +60,7 @@
  ***/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.76 2010/12/04 10:01:16 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: rf_disks.c,v 1.77 2011/02/13 06:17:35 enami Exp $);
 
 #include dev/raidframe/raidframevar.h
 
@@ -456,7 +456,7 @@
 			/* Found it.  Configure it.. */
 			diskPtr-blockSize = ac-clabel-blockSize;
 			diskPtr-numBlocks = ac-clabel-numBlocks;
-			diskPtr-numBlocks |= 
+			diskPtr-numBlocks |=
 			(uint64_t)ac-clabel-numBlocksHi  32;
 			/* Note: rf_protectedSectors is already
 			   factored into numBlocks here */



CVS commit: src/sys/dev/ata

2011-02-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Feb 10 05:07:46 UTC 2011

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
Start new line before issuing IDENTIFY command since messages from
other driver may interfere during waiting for command completion.


To generate a diff of this commit:
cvs rdiff -u -r1.385 -r1.386 src/sys/dev/ata/wd.c

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/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.385 src/sys/dev/ata/wd.c:1.386
--- src/sys/dev/ata/wd.c:1.385	Fri Nov  5 15:49:37 2010
+++ src/sys/dev/ata/wd.c	Thu Feb 10 05:07:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.385 2010/11/05 15:49:37 dyoung Exp $ */
+/*	$NetBSD: wd.c,v 1.386 2011/02/10 05:07:46 enami Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wd.c,v 1.385 2010/11/05 15:49:37 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: wd.c,v 1.386 2011/02/10 05:07:46 enami Exp $);
 
 #include opt_ata.h
 
@@ -281,10 +281,11 @@
 	wd-drvp-drv_softc = wd-sc_dev;
 
 	aprint_naive(\n);
+	aprint_normal(\n);
 
 	/* read our drive info */
 	if (wd_get_params(wd, AT_WAIT, wd-sc_params) != 0) {
-		aprint_error(\n%s: IDENTIFY failed\n, device_xname(self));
+		aprint_error_dev(self, IDENTIFY failed\n);
 		return;
 	}
 
@@ -304,7 +305,7 @@
 	}
 	*q++ = '\0';
 
-	aprint_normal(: %s\n, tbuf);
+	aprint_normal_dev(self, %s\n, tbuf);
 
 	wdq = wd_lookup_quirks(tbuf);
 	if (wdq != NULL)



CVS commit: src/crypto/external/bsd/openssh/dist

2011-02-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Feb  3 04:24:23 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: sshd_config.5

Log Message:
Note that our installed sshd_config overwrite the LoginGraceTime to 600s.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/sshd_config.5

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sshd_config.5
diff -u src/crypto/external/bsd/openssh/dist/sshd_config.5:1.7 src/crypto/external/bsd/openssh/dist/sshd_config.5:1.8
--- src/crypto/external/bsd/openssh/dist/sshd_config.5:1.7	Sun Nov 21 18:59:04 2010
+++ src/crypto/external/bsd/openssh/dist/sshd_config.5	Thu Feb  3 04:24:23 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: sshd_config.5,v 1.7 2010/11/21 18:59:04 adam Exp $
+.\	$NetBSD: sshd_config.5,v 1.8 2011/02/03 04:24:23 enami Exp $
 .\  -*- nroff -*-
 .\
 .\ Author: Tatu Ylonen y...@cs.hut.fi
@@ -36,7 +36,7 @@
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .\ $OpenBSD: sshd_config.5,v 1.125 2010/06/30 07:28:34 jmc Exp $
-.Dd June 30, 2010
+.Dd February 3, 2010
 .Dt SSHD_CONFIG 5
 .Os
 .Sh NAME
@@ -589,7 +589,9 @@
 The server disconnects after this time if the user has not
 successfully logged in.
 If the value is 0, there is no time limit.
-The default is 120 seconds.
+The default is 120 seconds but the default
+.Pa /etc/ssh/sshd_config
+overwrites it to 600 seconds.
 .It Cm LogLevel
 Gives the verbosity level that is used when logging messages from
 .Xr sshd 8 .



CVS commit: src/sys/uvm

2011-01-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Jan 26 08:49:49 UTC 2011

Modified Files:
src/sys/uvm: uvm_pglist.c

Log Message:
Introducing inner loop prevent us from exiting from the original loop.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/uvm/uvm_pglist.c

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

Modified files:

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.59 src/sys/uvm/uvm_pglist.c:1.60
--- src/sys/uvm/uvm_pglist.c:1.59	Tue Jan 25 17:22:43 2011
+++ src/sys/uvm/uvm_pglist.c	Wed Jan 26 08:49:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.59 2011/01/25 17:22:43 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.60 2011/01/26 08:49:48 enami Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.59 2011/01/25 17:22:43 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_pglist.c,v 1.60 2011/01/26 08:49:48 enami Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -390,8 +390,9 @@
 	if (high = ps-avail_start || low = ps-avail_end)
 		return 0;
 
+again:
 	for (;; try++, pg++) {
-		while (try = limit) {
+		if (try = limit) {
 			if (ps-start_hint == 0 || second_pass) {
 try = limit - 1;
 break;
@@ -400,6 +401,7 @@
 			try = max(low, ps-avail_start);
 			limit = min(limit, ps-avail_start + ps-start_hint);
 			pg = ps-pgs[try - ps-start];
+			goto again;
 		}
 #if defined(DEBUG)
 		{



CVS commit: src/share/man/man9

2011-01-24 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Jan 24 10:22:15 UTC 2011

Modified Files:
src/share/man/man9: roundup.9

Log Message:
roundup2(x, y) does not assume that x is power of 2, but y is.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/roundup.9

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

Modified files:

Index: src/share/man/man9/roundup.9
diff -u src/share/man/man9/roundup.9:1.3 src/share/man/man9/roundup.9:1.4
--- src/share/man/man9/roundup.9:1.3	Tue Jun  8 09:02:55 2010
+++ src/share/man/man9/roundup.9	Mon Jan 24 10:22:15 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: roundup.9,v 1.3 2010/06/08 09:02:55 jruoho Exp $
+.\ $NetBSD: roundup.9,v 1.4 2011/01/24 10:22:15 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -65,7 +65,7 @@
 The
 .Fn roundup2
 macro also rounds up, but with the assumption that
-.Fa x
+.Fa size
 is a power of two.
 If
 .Fa x



CVS commit: src/sys/uvm

2011-01-24 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Jan 25 03:34:30 UTC 2011

Modified Files:
src/sys/uvm: uvm_aobj.c

Log Message:
Remove nop code; the code is moved to uao_dropswap_range1() when it is
introduced in rev. 1.75.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/uvm/uvm_aobj.c

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

Modified files:

Index: src/sys/uvm/uvm_aobj.c
diff -u src/sys/uvm/uvm_aobj.c:1.110 src/sys/uvm/uvm_aobj.c:1.111
--- src/sys/uvm/uvm_aobj.c:1.110	Thu Jul 29 10:54:51 2010
+++ src/sys/uvm/uvm_aobj.c	Tue Jan 25 03:34:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_aobj.c,v 1.110 2010/07/29 10:54:51 hannken Exp $	*/
+/*	$NetBSD: uvm_aobj.c,v 1.111 2011/01/25 03:34:29 enami Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -43,7 +43,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_aobj.c,v 1.110 2010/07/29 10:54:51 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_aobj.c,v 1.111 2011/01/25 03:34:29 enami Exp $);
 
 #include opt_uvmhist.h
 
@@ -393,8 +393,6 @@
 static void
 uao_free(struct uvm_aobj *aobj)
 {
-	int swpgonlydelta = 0;
-
 
 #if defined(VMSWAP)
 	uao_dropswap_range1(aobj, 0, 0);
@@ -426,18 +424,6 @@
 
 	UVM_OBJ_DESTROY(aobj-u_obj);
 	pool_cache_put(uvm_aobj_cache, aobj);
-
-	/*
-	 * adjust the counter of pages only in swap for all
-	 * the swap slots we've freed.
-	 */
-
-	if (swpgonlydelta  0) {
-		mutex_enter(uvm_swap_data_lock);
-		KASSERT(uvmexp.swpgonly = swpgonlydelta);
-		uvmexp.swpgonly -= swpgonlydelta;
-		mutex_exit(uvm_swap_data_lock);
-	}
 }
 
 /*



CVS commit: src/sys/uvm

2011-01-05 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Jan  5 21:20:44 UTC 2011

Modified Files:
src/sys/uvm: uvm_stat.c

Log Message:
Fix format string; use PRIu64 for uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/uvm/uvm_stat.c

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

Modified files:

Index: src/sys/uvm/uvm_stat.c
diff -u src/sys/uvm/uvm_stat.c:1.34 src/sys/uvm/uvm_stat.c:1.35
--- src/sys/uvm/uvm_stat.c:1.34	Tue Jan  4 08:17:01 2011
+++ src/sys/uvm/uvm_stat.c	Wed Jan  5 21:20:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_stat.c,v 1.34 2011/01/04 08:17:01 matt Exp $	 */
+/*	$NetBSD: uvm_stat.c,v 1.35 2011/01/05 21:20:44 enami Exp $	 */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_stat.c,v 1.34 2011/01/04 08:17:01 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_stat.c,v 1.35 2011/01/05 21:20:44 enami Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -206,7 +206,8 @@
  * uvmexp_print: ddb hook to print interesting uvm counters
  */
 void
-uvmexp_print(void (*pr)(const char *, ...))
+uvmexp_print(void (*pr)(const char *, ...)
+__attribute__((__format__(__printf__,1,2
 {
 	int active, inactive;
 	CPU_INFO_ITERATOR cii;
@@ -229,7 +230,7 @@
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		(*pr)(  cpu%u:\n, cpu_index(ci));
 		(*pr)(faults=% PRIu64 , traps=% PRIu64 , 
-		intrs=%llu, ctxswitch=%llu\n,
+		intrs=% PRIu64 , ctxswitch=% PRIu64 \n,
 		ci-ci_data.cpu_nfault, ci-ci_data.cpu_ntrap,
 		ci-ci_data.cpu_nintr, ci-ci_data.cpu_nswtch);
 		(*pr)(softint=% PRIu64 , syscalls=% PRIu64 \n,



CVS commit: src/sys/uvm

2011-01-05 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Jan  6 05:51:57 UTC 2011

Modified Files:
src/sys/uvm: uvm_fault.c

Log Message:
Fix bugs introduced by previous commit; allocated page needs to be bound
with the anon, and uvmfault_anonget may be called with ufi NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/uvm/uvm_fault.c

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

Modified files:

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.179 src/sys/uvm/uvm_fault.c:1.180
--- src/sys/uvm/uvm_fault.c:1.179	Tue Jan  4 08:26:33 2011
+++ src/sys/uvm/uvm_fault.c	Thu Jan  6 05:51:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.179 2011/01/04 08:26:33 matt Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.180 2011/01/06 05:51:57 enami Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.179 2011/01/04 08:26:33 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.180 2011/01/06 05:51:57 enami Exp $);
 
 #include opt_uvmhist.h
 
@@ -361,8 +361,9 @@
 			 * no page, we must try and bring it in.
 			 */
 
-			pg = uvm_pagealloc(NULL, ufi-orig_rvaddr,
-			NULL, UVM_FLAG_COLORMATCH);
+			pg = uvm_pagealloc(NULL,
+			ufi != NULL ? ufi-orig_rvaddr : 0,
+			anon, UVM_FLAG_COLORMATCH);
 			if (pg == NULL) {		/* out of RAM.  */
 uvmfault_unlockall(ufi, amap, NULL, anon);
 uvmexp.fltnoram++;



CVS commit: src/usr.bin/vmstat

2010-12-24 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Dec 24 23:39:19 UTC 2010

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
We still need to update ouvmexp to output the differene from
previous iteration.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.171 src/usr.bin/vmstat/vmstat.c:1.172
--- src/usr.bin/vmstat/vmstat.c:1.171	Mon Dec 20 04:25:03 2010
+++ src/usr.bin/vmstat/vmstat.c	Fri Dec 24 23:39:19 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.171 2010/12/20 04:25:03 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.172 2010/12/24 23:39:19 enami Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.171 2010/12/20 04:25:03 christos Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.172 2010/12/24 23:39:19 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -736,6 +736,7 @@
 		(void)fflush(stdout);
 		if (reps = 0  --reps = 0)
 			break;
+		ouvmexp = uvmexp;
 		ocpucounter = cpucounter;
 		uptime = interval-tv_sec;
 		/*



CVS commit: src/bin/dd

2010-12-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Dec 22 09:39:06 UTC 2010

Modified Files:
src/bin/dd: args.c

Log Message:
Copy argument before modifying it so that ps shows entire argument.
From OpenBSD via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/bin/dd/args.c

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

Modified files:

Index: src/bin/dd/args.c
diff -u src/bin/dd/args.c:1.30 src/bin/dd/args.c:1.31
--- src/bin/dd/args.c:1.30	Tue Dec 14 19:03:21 2010
+++ src/bin/dd/args.c	Wed Dec 22 09:39:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.30 2010/12/14 19:03:21 pooka Exp $	*/
+/*	$NetBSD: args.c,v 1.31 2010/12/22 09:39:06 enami Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)args.c	8.3 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: args.c,v 1.30 2010/12/14 19:03:21 pooka Exp $);
+__RCSID($NetBSD: args.c,v 1.31 2010/12/22 09:39:06 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -120,6 +120,12 @@
 	in.dbsz = out.dbsz = 512;
 
 	while ((oper = *++argv) != NULL) {
+		if ((oper = strdup(oper)) == NULL) {
+			errx(EXIT_FAILURE,
+			unable to allocate space for the argument %s,
+			*argv);
+			/* NOTREACHED */
+		}
 		if ((arg = strchr(oper, '=')) == NULL) {
 			errx(EXIT_FAILURE, unknown operand %s, oper);
 			/* NOTREACHED */



CVS commit: src/bin/dd

2010-12-22 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Dec 22 09:42:53 UTC 2010

Modified Files:
src/bin/dd: args.c dd.1

Log Message:
Add iseek and oseek option as aliases for skip and seek respectively.
These options exist in dd of solaris or svr3.  From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/bin/dd/args.c
cvs rdiff -u -r1.22 -r1.23 src/bin/dd/dd.1

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

Modified files:

Index: src/bin/dd/args.c
diff -u src/bin/dd/args.c:1.31 src/bin/dd/args.c:1.32
--- src/bin/dd/args.c:1.31	Wed Dec 22 09:39:06 2010
+++ src/bin/dd/args.c	Wed Dec 22 09:42:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.31 2010/12/22 09:39:06 enami Exp $	*/
+/*	$NetBSD: args.c,v 1.32 2010/12/22 09:42:53 enami Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)args.c	8.3 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: args.c,v 1.31 2010/12/22 09:39:06 enami Exp $);
+__RCSID($NetBSD: args.c,v 1.32 2010/12/22 09:42:53 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -97,8 +97,10 @@
 	{ files,	f_files,	C_FILES, C_FILES },
 	{ ibs,	f_ibs,		C_IBS,	 C_BS|C_IBS },
 	{ if,		f_if,		C_IF,	 C_IF|C_RIF },
+	{ iseek,	f_skip,		C_SKIP,	 C_SKIP },
 	{ obs,	f_obs,		C_OBS,	 C_BS|C_OBS },
 	{ of,		f_of,		C_OF,	 C_OF|C_ROF },
+	{ oseek,	f_seek,		C_SEEK,	 C_SEEK },
 	{ progress,	f_progress,	0,	 0 },
 #ifdef _HAVE_RUMPOPS
 	{ rif,	f_rif,		C_RIF|C_RUMP,	 C_RIF|C_IF },

Index: src/bin/dd/dd.1
diff -u src/bin/dd/dd.1:1.22 src/bin/dd/dd.1:1.23
--- src/bin/dd/dd.1:1.22	Wed Mar 11 12:43:58 2009
+++ src/bin/dd/dd.1	Wed Dec 22 09:42:53 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: dd.1,v 1.22 2009/03/11 12:43:58 joerg Exp $
+.\	$NetBSD: dd.1,v 1.23 2010/12/22 09:42:53 enami Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\	@(#)dd.1	8.2 (Berkeley) 1/13/94
 .\
-.Dd April 13, 2007
+.Dd December 22, 2010
 .Dt DD 1
 .Os
 .Sh NAME
@@ -91,6 +91,12 @@
 Read input from
 .Ar file
 instead of the standard input.
+.It Cm iseek= Ns Ar n
+Seek on the input file
+.Ar n
+blocks.
+This is synonymous with
+.Cm skip= Ns Ar n .
 .It Cm obs= Ns Ar n
 Set the output block size to
 .Va n
@@ -106,6 +112,12 @@
 .Cm seek
 operand)
 the output file is truncated at that point.
+.It Cm oseek= Ns Ar n
+Seek on the output file
+.Ar n
+blocks.
+This is synonymous with
+.Cm seek= Ns Ar n .
 .It Cm seek= Ns Ar n
 Seek
 .Va n



CVS commit: src/external/bsd/bind

2010-12-14 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Dec 15 07:36:52 UTC 2010

Modified Files:
src/external/bsd/bind: Makefile.inc

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/bind/Makefile.inc

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/bind/Makefile.inc
diff -u src/external/bsd/bind/Makefile.inc:1.8 src/external/bsd/bind/Makefile.inc:1.9
--- src/external/bsd/bind/Makefile.inc:1.8	Wed Dec 15 02:08:16 2010
+++ src/external/bsd/bind/Makefile.inc	Wed Dec 15 07:36:51 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.8 2010/12/15 02:08:16 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.9 2010/12/15 07:36:51 enami Exp $
 
 .if !defined(BIND9_MAKEFILE_INC)
 BIND9_MAKEFILE_INC=yes
@@ -94,7 +94,7 @@
 DPADD+= ${LIBCRYPTO}
 .else
 .if exists(${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto)
-LIBDPLIBS+=	crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypt)
+LIBDPLIBS+=	crypto ${NETBSDSRCDIR}/crypto/external/bsd/openssl/lib/libcrypto
 .else
 LIBDPLIBS+=	crypto ${NETBSDSRCDIR}/lib/libcrypto
 .endif



CVS commit: src/bin/dd

2010-12-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Dec  9 10:24:56 UTC 2010

Modified Files:
src/bin/dd: args.c

Log Message:
Wrap long line.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/bin/dd/args.c

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

Modified files:

Index: src/bin/dd/args.c
diff -u src/bin/dd/args.c:1.28 src/bin/dd/args.c:1.29
--- src/bin/dd/args.c:1.28	Sun Dec  5 23:35:59 2010
+++ src/bin/dd/args.c	Thu Dec  9 10:24:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.28 2010/12/05 23:35:59 jym Exp $	*/
+/*	$NetBSD: args.c,v 1.29 2010/12/09 10:24:56 enami Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)args.c	8.3 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: args.c,v 1.28 2010/12/05 23:35:59 jym Exp $);
+__RCSID($NetBSD: args.c,v 1.29 2010/12/09 10:24:56 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -382,7 +382,8 @@
 			/* NOTREACHED */
 		}
 		if (ddflags  cp-noset) {
-			errx(EXIT_FAILURE, %s: illegal conversion combination, tmp.name);
+			errx(EXIT_FAILURE,
+			%s: illegal conversion combination, tmp.name);
 			/* NOTREACHED */
 		}
 		ddflags |= cp-set;



CVS commit: src/usr.bin/pkill

2010-12-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Dec  7 09:00:24 UTC 2010

Modified Files:
src/usr.bin/pkill: pkill.1

Log Message:
Fix SYNOPSIS; pkill accepts -l options since 3 years ago.  `pattern' is
mandatory for all commands and `priority' is mandatory for prenice.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/pkill/pkill.1

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/pkill/pkill.1
diff -u src/usr.bin/pkill/pkill.1:1.22 src/usr.bin/pkill/pkill.1:1.23
--- src/usr.bin/pkill/pkill.1:1.22	Tue Dec  7 08:55:52 2010
+++ src/usr.bin/pkill/pkill.1	Tue Dec  7 09:00:23 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: pkill.1,v 1.22 2010/12/07 08:55:52 wiz Exp $
+.\	$NetBSD: pkill.1,v 1.23 2010/12/07 09:00:23 enami Exp $
 .\
 .\ Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -44,10 +44,10 @@
 .Op Fl t Ar tty
 .Op Fl U Ar uid
 .Op Fl u Ar euid
-.Op Ar pattern ...
+.Ar pattern ...
 .Nm pkill
 .Op Fl signal
-.Op Fl finvx
+.Op Fl filnvx
 .Op Fl G Ar gid
 .Op Fl g Ar pgrp
 .Op Fl P Ar ppid
@@ -55,11 +55,11 @@
 .Op Fl t Ar tty
 .Op Fl U Ar uid
 .Op Fl u Ar euid
-.Op Ar pattern ...
+.Ar pattern ...
 .Nm prenice
 .Op Fl l
-.Op Ar priority
-.Op Ar pattern ...
+.Ar priority
+.Ar pattern ...
 .Sh DESCRIPTION
 The
 .Nm pgrep



CVS commit: src/lib/libc/stdlib

2010-11-15 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Nov 16 03:02:20 UTC 2010

Modified Files:
src/lib/libc/stdlib: _env.c

Log Message:
Fix typos in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/stdlib/_env.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/libc/stdlib/_env.c
diff -u src/lib/libc/stdlib/_env.c:1.2 src/lib/libc/stdlib/_env.c:1.3
--- src/lib/libc/stdlib/_env.c:1.2	Sun Nov 14 22:04:36 2010
+++ src/lib/libc/stdlib/_env.c	Tue Nov 16 03:02:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: _env.c,v 1.2 2010/11/14 22:04:36 tron Exp $ */
+/*	$NetBSD: _env.c,v 1.3 2010/11/16 03:02:20 enami Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
 
 #define	ENV_ARRAY_SIZE_MIN	16
 
-/* The lock protecting accces to the environment. */
+/* The lock protecting access to the environment. */
 #ifdef _REENTRANT
 static rwlock_t env_lock = RWLOCK_INITIALIZER;
 #endif
@@ -176,9 +176,9 @@
 }
 
 /*
- * Check whether an enviroment variable is writable. This function must be
+ * Check whether an environment variable is writable. This function must be
  * called with the environment write locked as the caller will probably
- * overwrite the enviroment variable afterwards.
+ * overwrite the environment variable afterwards.
  */
 bool
 __canoverwriteenvvar(char *envvar, size_t length)
@@ -265,7 +265,7 @@
 	(void)memset(new_environ[num_entries], 0,
 	(new_size - num_entries) * sizeof(*new_environ));
 
-	/* Use the new environent array. */
+	/* Use the new environment array. */
 	environ = allocated_environ = new_environ;
 	allocated_environ_size = new_size;
 



CVS commit: src/sys/uvm

2010-11-15 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Nov 16 03:49:54 UTC 2010

Modified Files:
src/sys/uvm: uvm_meter.c

Log Message:
Nowadays, comparing priority against PZERO doesn't make any sense.
Instead, see if a process waits uninterruptibly like ps does,
so that the second column (`b') of default vmstat output prints
some useful value (-t is still broken though).


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/uvm/uvm_meter.c

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

Modified files:

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.53 src/sys/uvm/uvm_meter.c:1.54
--- src/sys/uvm/uvm_meter.c:1.53	Sat Nov  6 12:18:17 2010
+++ src/sys/uvm/uvm_meter.c	Tue Nov 16 03:49:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.53 2010/11/06 12:18:17 uebayasi Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.54 2010/11/16 03:49:53 enami Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.53 2010/11/06 12:18:17 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_meter.c,v 1.54 2010/11/16 03:49:53 enami Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -310,7 +310,7 @@
 
 		case LSSLEEP:
 		case LSSTOP:
-			if (lwp_eprio(l) = PZERO) {
+			if ((l-l_flag  LW_SINTR) == 0) {
 totalp-t_dw++;
 			} else if (l-l_slptime  maxslp) {
 totalp-t_sl++;



CVS commit: src/lib/libc/stdlib

2010-11-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Nov 10 02:33:49 UTC 2010

Modified Files:
src/lib/libc/stdlib: getenv.c

Log Message:
Indent using tab rather than four spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/stdlib/getenv.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/libc/stdlib/getenv.c
diff -u src/lib/libc/stdlib/getenv.c:1.30 src/lib/libc/stdlib/getenv.c:1.31
--- src/lib/libc/stdlib/getenv.c:1.30	Thu Nov  4 21:49:45 2010
+++ src/lib/libc/stdlib/getenv.c	Wed Nov 10 02:33:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getenv.c,v 1.30 2010/11/04 21:49:45 christos Exp $	*/
+/*	$NetBSD: getenv.c,v 1.31 2010/11/10 02:33:49 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)getenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: getenv.c,v 1.30 2010/11/04 21:49:45 christos Exp $);
+__RCSID($NetBSD: getenv.c,v 1.31 2010/11/10 02:33:49 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -166,10 +166,10 @@
 		return;
 
 	for (; environ[offset]; offset++)
-	if (environ[offset] == __environ_malloced[offset]) {
-		free(__environ_malloced[offset]);
-		environ[offset] = __environ_malloced[offset] = NULL;
-	}
+		if (environ[offset] == __environ_malloced[offset]) {
+			free(__environ_malloced[offset]);
+			environ[offset] = __environ_malloced[offset] = NULL;
+		}
 
 	environ[offset] = __environ_malloced[offset] = NULL;
 }



CVS commit: src/lib/libc/stdlib

2010-11-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Nov 10 02:40:08 UTC 2010

Modified Files:
src/lib/libc/stdlib: getenv.c

Log Message:
Clear all entries past the NULL while scrubing environ vector.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/stdlib/getenv.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/libc/stdlib/getenv.c
diff -u src/lib/libc/stdlib/getenv.c:1.31 src/lib/libc/stdlib/getenv.c:1.32
--- src/lib/libc/stdlib/getenv.c:1.31	Wed Nov 10 02:33:49 2010
+++ src/lib/libc/stdlib/getenv.c	Wed Nov 10 02:40:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getenv.c,v 1.31 2010/11/10 02:33:49 enami Exp $	*/
+/*	$NetBSD: getenv.c,v 1.32 2010/11/10 02:40:08 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)getenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: getenv.c,v 1.31 2010/11/10 02:33:49 enami Exp $);
+__RCSID($NetBSD: getenv.c,v 1.32 2010/11/10 02:40:08 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -165,13 +165,11 @@
 	if (environ[++offset] == NULL)
 		return;
 
-	for (; environ[offset]; offset++)
-		if (environ[offset] == __environ_malloced[offset]) {
+	for (; environ[offset]; offset++) {
+		if (environ[offset] == __environ_malloced[offset])
 			free(__environ_malloced[offset]);
-			environ[offset] = __environ_malloced[offset] = NULL;
-		}
-
-	environ[offset] = __environ_malloced[offset] = NULL;
+		environ[offset] = __environ_malloced[offset] = NULL;
+	}
 }
 
 /*



CVS commit: src/share/man/man3

2010-11-08 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Nov  8 09:43:27 UTC 2010

Modified Files:
src/share/man/man3: rbtree.3

Log Message:
Fix typo in previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/rbtree.3

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

Modified files:

Index: src/share/man/man3/rbtree.3
diff -u src/share/man/man3/rbtree.3:1.2 src/share/man/man3/rbtree.3:1.3
--- src/share/man/man3/rbtree.3:1.2	Mon Nov  8 03:20:59 2010
+++ src/share/man/man3/rbtree.3	Mon Nov  8 09:43:27 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: rbtree.3,v 1.2 2010/11/08 03:20:59 enami Exp $
+.\ $NetBSD: rbtree.3,v 1.3 2010/11/08 09:43:27 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -127,7 +127,7 @@
 already existing node on failure.
 .It Fn rb_tree_remove_node rbt rb
 Remove the node
-.Fa node
+.Fa rb
 from the tree
 .Fa rbt .
 .It Fn rb_tree_find_node rbt key



CVS commit: src/share/man/man3

2010-11-07 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Nov  8 03:20:59 UTC 2010

Modified Files:
src/share/man/man3: rbtree.3

Log Message:
- Add library section.
- Fix function signatures.
- Describe added member to an ops structure.
- Describe rb_tree_remove_node.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/rbtree.3

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

Modified files:

Index: src/share/man/man3/rbtree.3
diff -u src/share/man/man3/rbtree.3:1.1 src/share/man/man3/rbtree.3:1.2
--- src/share/man/man3/rbtree.3:1.1	Sun Oct 24 06:57:04 2010
+++ src/share/man/man3/rbtree.3	Mon Nov  8 03:20:59 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: rbtree.3,v 1.1 2010/10/24 06:57:04 jruoho Exp $
+.\ $NetBSD: rbtree.3,v 1.2 2010/11/08 03:20:59 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,26 +27,30 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 24, 2010
+.Dd November 8, 2010
 .Dt RBTREE 3
 .Os
 .Sh NAME
 .Nm rbtree
 .Nd red-black tree
+.Sh LIBRARY
+.Lb libc
 .Sh SYNOPSIS
 .In sys/rbtree.h
 .Ft void
-.Fn rb_tree_init struct rb_tree * const struct rb_tree_ops *
-.Ft bool
-.Fn rb_tree_insert_node struct rb_tree * struct rb_node *
-.Ft struct rb_node *
-.Fn rb_tree_find_node struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_find_node_geq struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_find_node_leq struct rb_tree * const void *
-.Ft struct rb_node *
-.Fn rb_tree_iterate struct rb_tree * struct rb_node * const unsigned int
+.Fn rb_tree_init rb_tree_t * const rb_tree_ops_t *
+.Ft void *
+.Fn rb_tree_insert_node rb_tree_t * void *
+.Ft void
+.Fn rb_tree_remove_node rb_tree_t * void *
+.Ft void *
+.Fn rb_tree_find_node rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_find_node_geq rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_find_node_leq rb_tree_t * const void *
+.Ft void *
+.Fn rb_tree_iterate rb_tree_t * void * const unsigned int
 .Sh DESCRIPTION
 .Nm
 provides red-black trees.
@@ -67,10 +71,10 @@
 The maximum height of a red-black tree is 2lg (n+1).
 .Sh TYPES
 .Bl -tag -width compact
-.It Vt struct rb_tree
+.It Vt rb_tree_t
 A red-black tree.
 .It Vt typedef signed int \
-(*const rbto_compare_nodes_fn)(const struct rb_node *, const struct rb_node *);
+(*const rbto_compare_nodes_fn)(void *, const void *, const void *);
 The node-comparison operator.
 Defines an ordering on nodes.
 Returns a positive value if the first node precedes the second node.
@@ -78,24 +82,30 @@
 Returns 0 if the first node and the second are identical according
 to the ordering.
 .It Vt typedef signed int \
-(*const rbto_compare_key_fn)(const struct rb_node *, const void *);
+(*const rbto_compare_key_fn)(void *, const void *, const void *);
 The node-key comparison operator.
 Defines the order of nodes and keys.
 Returns a positive value if the node precedes the key.
 Returns a negative value if the node follows the key.
 Returns 0 if the node is identical to the key according to the ordering.
-.It Vt struct rb_tree_ops
-Defines the operators for comparing two nodes in the same tree,
-and for comparing a node in the tree with a key.
+.It Vt rb_tree_ops_t
+Defines the operator for comparing two nodes in the same tree,
+the operator for comparing a node in the tree with a key,
+the offset of member
+.Vt rb_node_t
+within a node,
+and the opaque context passed to the operators.
 Members of
-.Vt rb_tree_ops
+.Vt rb_tree_ops_t
 are
 .Bd -literal
 rbto_compare_nodes_fn rbto_compare_nodes;
 rbto_compare_key_fn rbto_compare_key;
+size_t rbto_node_offset;
+void *rbto_context;
 .Ed
-.It Vt struct rb_node
-A node in a red-black tree.
+.It Vt rb_node_t
+A node in a red-black tree has this structure as a member.
 .El
 .Sh FUNCTIONS
 .Bl -tag -width compact
@@ -113,11 +123,13 @@
 .Fa rb
 into the tree
 .Fa rbt .
-Return
-.Dv true
-on success,
-.Dv false
-on failure.
+Return inserted node on success,
+already existing node on failure.
+.It Fn rb_tree_remove_node rbt rb
+Remove the node
+.Fa node
+from the tree
+.Fa rbt .
 .It Fn rb_tree_find_node rbt key
 Search the tree
 .Fa rbt



CVS commit: src/lib/libc/stdlib

2010-11-01 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Nov  2 03:44:05 UTC 2010

Modified Files:
src/lib/libc/stdlib: getenv.c

Log Message:
- Simplify the code
- Reword the comment.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/stdlib/getenv.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/libc/stdlib/getenv.c
diff -u src/lib/libc/stdlib/getenv.c:1.27 src/lib/libc/stdlib/getenv.c:1.28
--- src/lib/libc/stdlib/getenv.c:1.27	Mon Nov  1 02:41:27 2010
+++ src/lib/libc/stdlib/getenv.c	Tue Nov  2 03:44:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getenv.c,v 1.27 2010/11/01 02:41:27 enami Exp $	*/
+/*	$NetBSD: getenv.c,v 1.28 2010/11/02 03:44:05 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)getenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: getenv.c,v 1.27 2010/11/01 02:41:27 enami Exp $);
+__RCSID($NetBSD: getenv.c,v 1.28 2010/11/02 03:44:05 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -119,10 +119,10 @@
 	if (required_len = environ_malloced_len  saveenv == environ)
 		return 0;
 
-	/* Make sure we at least double the size of the arrays. */
-	new_len = environ_malloced_len = 16 ? environ_malloced_len : 16;
+	/* Double the size of the arrays until we meet the requirement. */
+	new_len = environ_malloced_len ? environ_malloced_len : 16;
 	while (new_len  required_len)
-		new_len = new_len  1;
+		new_len = 1;
 
 	if (saveenv == environ) {		/* just increase size */
 		if ((p = realloc(saveenv, new_len * sizeof(*p))) == NULL)



CVS commit: src/lib/libc/stdlib

2010-10-31 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Nov  1 02:41:27 UTC 2010

Modified Files:
src/lib/libc/stdlib: getenv.c

Log Message:
Double the array only when really necessary.  Otherwise memory will be
exhausted if user modifies the variable envrion itself repeatedly..


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/stdlib/getenv.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/libc/stdlib/getenv.c
diff -u src/lib/libc/stdlib/getenv.c:1.26 src/lib/libc/stdlib/getenv.c:1.27
--- src/lib/libc/stdlib/getenv.c:1.26	Sun Oct 24 17:53:27 2010
+++ src/lib/libc/stdlib/getenv.c	Mon Nov  1 02:41:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getenv.c,v 1.26 2010/10/24 17:53:27 tron Exp $	*/
+/*	$NetBSD: getenv.c,v 1.27 2010/11/01 02:41:27 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)getenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: getenv.c,v 1.26 2010/10/24 17:53:27 tron Exp $);
+__RCSID($NetBSD: getenv.c,v 1.27 2010/11/01 02:41:27 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -120,8 +120,7 @@
 		return 0;
 
 	/* Make sure we at least double the size of the arrays. */
-	new_len = (environ_malloced_len = 16) ?
-	(environ_malloced_len  1) : 16;
+	new_len = environ_malloced_len = 16 ? environ_malloced_len : 16;
 	while (new_len  required_len)
 		new_len = new_len  1;
 



CVS commit: src/sys/netinet

2010-10-06 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Oct  6 07:39:37 UTC 2010

Modified Files:
src/sys/netinet: ip_reass.c

Log Message:
Don't free memory still in use.  Fixes nfs root problem reported
by Christoph Egger on source-changes-d.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/netinet/ip_reass.c

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

Modified files:

Index: src/sys/netinet/ip_reass.c
diff -u src/sys/netinet/ip_reass.c:1.4 src/sys/netinet/ip_reass.c:1.5
--- src/sys/netinet/ip_reass.c:1.4	Sun Oct  3 19:44:47 2010
+++ src/sys/netinet/ip_reass.c	Wed Oct  6 07:39:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.4 2010/10/03 19:44:47 rmind Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.5 2010/10/06 07:39:37 enami Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_reass.c,v 1.4 2010/10/03 19:44:47 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_reass.c,v 1.5 2010/10/06 07:39:37 enami Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -390,7 +390,6 @@
 		pool_cache_put(ipfren_cache, q);
 		m_cat(m, t);
 	}
-	free(fp, M_FTABLE);
 
 	/*
 	 * Create header for new packet by modifying header of first
@@ -400,6 +399,7 @@
 	ip-ip_len = htons((ip-ip_hl  2) + next);
 	ip-ip_src = fp-ipq_src;
 	ip-ip_dst = fp-ipq_dst;
+	free(fp, M_FTABLE);
 
 	m-m_len += (ip-ip_hl  2);
 	m-m_data -= (ip-ip_hl  2);



CVS commit: src/lib/libc/stdio

2010-10-06 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Oct  7 00:14:14 UTC 2010

Modified Files:
src/lib/libc/stdio: fmemopen.3

Log Message:
The was is not an argument but simply a part of sentense.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/stdio/fmemopen.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/libc/stdio/fmemopen.3
diff -u src/lib/libc/stdio/fmemopen.3:1.4 src/lib/libc/stdio/fmemopen.3:1.5
--- src/lib/libc/stdio/fmemopen.3:1.4	Tue Sep 28 00:39:56 2010
+++ src/lib/libc/stdio/fmemopen.3	Thu Oct  7 00:14:14 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fmemopen.3,v 1.4 2010/09/28 00:39:56 enami Exp $
+.\	$NetBSD: fmemopen.3,v 1.5 2010/10/07 00:14:14 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -157,7 +157,8 @@
 .Bl -tag -width Er
 .It Bq Er EINVAL
 The
-.Fa size was
+.Fa size
+was
 .Dv 0 ;
 or the
 .Fa mode



CVS commit: src/lib/libc/stdlib

2010-10-04 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Oct  5 02:23:39 UTC 2010

Modified Files:
src/lib/libc/stdlib: putenv.c

Log Message:
Avoid unnecessary malloc().  Since __findenv() kindly treats
equal sign as an end of string, we can pass the string of
form key=value to lookup key.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/stdlib/putenv.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/libc/stdlib/putenv.c
diff -u src/lib/libc/stdlib/putenv.c:1.15 src/lib/libc/stdlib/putenv.c:1.16
--- src/lib/libc/stdlib/putenv.c:1.15	Sat Oct  2 16:56:03 2010
+++ src/lib/libc/stdlib/putenv.c	Tue Oct  5 02:23:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: putenv.c,v 1.15 2010/10/02 16:56:03 tron Exp $	*/
+/*	$NetBSD: putenv.c,v 1.16 2010/10/05 02:23:38 enami Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)putenv.c	8.2 (Berkeley) 3/27/94;
 #else
-__RCSID($NetBSD: putenv.c,v 1.15 2010/10/02 16:56:03 tron Exp $);
+__RCSID($NetBSD: putenv.c,v 1.16 2010/10/05 02:23:38 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -54,28 +54,18 @@
 int
 putenv(char *str)
 {
-	char *name, *equal, *p;
-	size_t namelen;
+	char *p;
 	int offset;
 
 	_DIAGASSERT(str != NULL);
 
-	if ((equal = strchr(str, '=')) == NULL)
+	if (strchr(str, '=') == NULL)
 		return -1;
 
-	namelen = equal - str;
-	if ((name = malloc(namelen + 1)) == NULL)
+	if (rwlock_wrlock(__environ_lock) != 0)
 		return -1;
-	(void)memcpy(name, str, namelen);
-	name[namelen] = '\0';
 
-	if (rwlock_wrlock(__environ_lock) != 0) {
-		free(name);
-		return -1;
-	}
-
-	p = __findenv(name, offset);
-	free(name);
+	p = __findenv(str, offset);
 
 	if (__allocenv(offset) == -1)
 		goto bad;



CVS commit: src/lib/libc/stdlib

2010-09-28 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Sep 29 00:40:17 UTC 2010

Modified Files:
src/lib/libc/stdlib: unsetenv.c

Log Message:
Don't put space before close paren.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/unsetenv.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/libc/stdlib/unsetenv.c
diff -u src/lib/libc/stdlib/unsetenv.c:1.7 src/lib/libc/stdlib/unsetenv.c:1.8
--- src/lib/libc/stdlib/unsetenv.c:1.7	Sat Sep 25 18:37:24 2010
+++ src/lib/libc/stdlib/unsetenv.c	Wed Sep 29 00:40:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: unsetenv.c,v 1.7 2010/09/25 18:37:24 tron Exp $	*/
+/*	$NetBSD: unsetenv.c,v 1.8 2010/09/29 00:40:17 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)setenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: unsetenv.c,v 1.7 2010/09/25 18:37:24 tron Exp $);
+__RCSID($NetBSD: unsetenv.c,v 1.8 2010/09/29 00:40:17 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -72,7 +72,7 @@
 		return -1;
 	}
 
-	while (__findenv(name, offset) != NULL ) { /* if set multiple times */
+	while (__findenv(name, offset) != NULL) { /* if set multiple times */
 		free(__environ_malloced[offset]);
 
 		while (environ[offset] != NULL) {



CVS commit: src/lib/libc/stdlib

2010-09-28 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Sep 29 00:44:05 UTC 2010

Modified Files:
src/lib/libc/stdlib: getenv.c

Log Message:
If new length is exactly equals to the current length,
there is nothing to do.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/stdlib/getenv.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/libc/stdlib/getenv.c
diff -u src/lib/libc/stdlib/getenv.c:1.22 src/lib/libc/stdlib/getenv.c:1.23
--- src/lib/libc/stdlib/getenv.c:1.22	Sat Sep 25 19:31:51 2010
+++ src/lib/libc/stdlib/getenv.c	Wed Sep 29 00:44:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getenv.c,v 1.22 2010/09/25 19:31:51 christos Exp $	*/
+/*	$NetBSD: getenv.c,v 1.23 2010/09/29 00:44:04 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)getenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: getenv.c,v 1.22 2010/09/25 19:31:51 christos Exp $);
+__RCSID($NetBSD: getenv.c,v 1.23 2010/09/29 00:44:04 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -113,7 +113,7 @@
 	}
 
 	nl = offset + 2; 	/* one for potentially new entry one for NULL */
-	if (nl  environ_malloced_len)
+	if (nl = environ_malloced_len)
 		return 0;
 
 	p = realloc(__environ_malloced, nl * sizeof(*p));



CVS commit: src/lib/libc/stdio

2010-09-27 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Sep 28 00:39:56 UTC 2010

Modified Files:
src/lib/libc/stdio: fmemopen.3

Log Message:
Add missing period at the end of sentense.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/stdio/fmemopen.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/libc/stdio/fmemopen.3
diff -u src/lib/libc/stdio/fmemopen.3:1.3 src/lib/libc/stdio/fmemopen.3:1.4
--- src/lib/libc/stdio/fmemopen.3:1.3	Sat Sep 25 09:44:08 2010
+++ src/lib/libc/stdio/fmemopen.3	Tue Sep 28 00:39:56 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: fmemopen.3,v 1.3 2010/09/25 09:44:08 wiz Exp $
+.\	$NetBSD: fmemopen.3,v 1.4 2010/09/28 00:39:56 enami Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -98,7 +98,7 @@
 The stream also keeps track of the
 .Fa size
 of the
-.Fa buffer
+.Fa buffer .
 The
 .Fa size
 is initialized depending on the mode:



CVS commit: src/sys/ddb

2010-08-31 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 07:12:55 UTC 2010

Modified Files:
src/sys/ddb: db_input.c

Log Message:
Fix indent in prevous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/ddb/db_input.c

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

Modified files:

Index: src/sys/ddb/db_input.c
diff -u src/sys/ddb/db_input.c:1.24 src/sys/ddb/db_input.c:1.25
--- src/sys/ddb/db_input.c:1.24	Mon Aug 30 19:23:25 2010
+++ src/sys/ddb/db_input.c	Tue Aug 31 07:12:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_input.c,v 1.24 2010/08/30 19:23:25 tls Exp $	*/
+/*	$NetBSD: db_input.c,v 1.25 2010/08/31 07:12:55 enami Exp $	*/
 
 /*
  * Mach Operating System
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_input.c,v 1.24 2010/08/30 19:23:25 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_input.c,v 1.25 2010/08/31 07:12:55 enami Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ddbparam.h
@@ -134,12 +134,12 @@
 #define INC_DB_CURR() do {		\
 	++db_history_curr;		\
 	if (db_history_curr  db_history + DDB_HISTORY_SIZE - 1)	\
-	db_history_curr = db_history;\
+		db_history_curr = db_history;\
 } while (0)
 #define DEC_DB_CURR() do {		\
 	--db_history_curr;		\
 	if (db_history_curr  db_history)\
-	db_history_curr = db_history + DDB_HISTORY_SIZE - 1;	\
+		db_history_curr = db_history + DDB_HISTORY_SIZE - 1;	\
 } while (0)
 #endif
 



CVS commit: src/sys/ddb

2010-08-31 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 07:48:23 UTC 2010

Modified Files:
src/sys/ddb: db_input.c

Log Message:
Define db_hist_put() only when DDB_HISTORY_SIZE != 0 so that
build successes on ports like hpcarm.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/ddb/db_input.c

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

Modified files:

Index: src/sys/ddb/db_input.c
diff -u src/sys/ddb/db_input.c:1.25 src/sys/ddb/db_input.c:1.26
--- src/sys/ddb/db_input.c:1.25	Tue Aug 31 07:12:55 2010
+++ src/sys/ddb/db_input.c	Tue Aug 31 07:48:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_input.c,v 1.25 2010/08/31 07:12:55 enami Exp $	*/
+/*	$NetBSD: db_input.c,v 1.26 2010/08/31 07:48:23 enami Exp $	*/
 
 /*
  * Mach Operating System
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_input.c,v 1.25 2010/08/31 07:12:55 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_input.c,v 1.26 2010/08/31 07:48:23 enami Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ddbparam.h
@@ -141,9 +141,9 @@
 	if (db_history_curr  db_history)\
 		db_history_curr = db_history + DDB_HISTORY_SIZE - 1;	\
 } while (0)
-#endif
 
-static inline void db_hist_put(int c)
+static inline void
+db_hist_put(int c)
 {
 	KASSERT(db_history[0]  = db_history_last);
 	KASSERT(db_history_last = db_history[DDB_HISTORY_SIZE-1]);
@@ -153,6 +153,7 @@
 	if (db_history_last  db_history[DDB_HISTORY_SIZE-1])
 	db_history_last = db_history;
 }
+#endif
 	
 
 /* returns true at end-of-line */



CVS commit: src/bin/pax

2010-08-30 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 03:16:06 UTC 2010

Modified Files:
src/bin/pax: ar_io.c options.c

Log Message:
- Raise an error rather than silently creating broken archive
  if user don't specify --force-local but opened file is actually
  a local file.
- Make cpio to accept -F option as described in manpage.
- Make pax to set forcelocal flag if requested to do so.
- Add missing break statement.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/pax/ar_io.c
cvs rdiff -u -r1.108 -r1.109 src/bin/pax/options.c

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

Modified files:

Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.49 src/bin/pax/ar_io.c:1.50
--- src/bin/pax/ar_io.c:1.49	Tue Feb  3 05:22:40 2009
+++ src/bin/pax/ar_io.c	Tue Aug 31 03:16:06 2010
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)ar_io.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ar_io.c,v 1.49 2009/02/03 05:22:40 dbj Exp $);
+__RCSID($NetBSD: ar_io.c,v 1.50 2010/08/31 03:16:06 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -147,6 +147,11 @@
 			syswarn(0, errno, Failed open on %s, name);
 			return -1;
 		}
+		if (!isrmt(arfd)) {
+			rmtclose(arfd);
+			tty_warn(0, Not a remote file: %s, name);
+			return -1;
+		}
 		blksz = rdblksz = 8192;
 		lstrval = 1;
 		return 0;

Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.108 src/bin/pax/options.c:1.109
--- src/bin/pax/options.c:1.108	Wed Aug 25 21:36:02 2010
+++ src/bin/pax/options.c	Tue Aug 31 03:16:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.108 2010/08/25 21:36:02 sjg Exp $	*/
+/*	$NetBSD: options.c,v 1.109 2010/08/31 03:16:06 enami Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)options.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: options.c,v 1.108 2010/08/25 21:36:02 sjg Exp $);
+__RCSID($NetBSD: options.c,v 1.109 2010/08/31 03:16:06 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -643,7 +643,7 @@
 			secure = 0;
 			break;
 		case OPT_FORCE_LOCAL:
-			forcelocal = 0;
+			forcelocal = 1;
 			break;
 		case OPT_USE_COMPRESS_PROGRAM:
 			zflag = 1;
@@ -1677,6 +1677,7 @@
 			(void)fputs(\n\n, stderr);
 			cpio_usage();
 			break;
+		case 'F':
 		case 'I':
 		case 'O':
 			/*
@@ -1734,13 +1735,13 @@
 			 * process Version 6 cpio format
 			 */
 			frmt = (fsub[F_BCPIO]);
+			break;
 		case OPT_FORCE_LOCAL:
 			forcelocal = 1;
 			break;
 		case OPT_INSECURE:
 			secure = 0;
 			break;
-
 		case OPT_SPARSE:
 			/* do nothing; we already generate sparse files */
 			break;



CVS commit: src/bin/pax

2010-08-30 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 04:50:07 UTC 2010

Modified Files:
src/bin/pax: ar_io.c

Log Message:
Fix build as tools.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/bin/pax/ar_io.c

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

Modified files:

Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.50 src/bin/pax/ar_io.c:1.51
--- src/bin/pax/ar_io.c:1.50	Tue Aug 31 03:16:06 2010
+++ src/bin/pax/ar_io.c	Tue Aug 31 04:50:07 2010
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)ar_io.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ar_io.c,v 1.50 2010/08/31 03:16:06 enami Exp $);
+__RCSID($NetBSD: ar_io.c,v 1.51 2010/08/31 04:50:07 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -147,11 +147,13 @@
 			syswarn(0, errno, Failed open on %s, name);
 			return -1;
 		}
+#if !HAVE_NBTOOL_CONFIG_H
 		if (!isrmt(arfd)) {
 			rmtclose(arfd);
 			tty_warn(0, Not a remote file: %s, name);
 			return -1;
 		}
+#endif
 		blksz = rdblksz = 8192;
 		lstrval = 1;
 		return 0;



CVS commit: src/bin/pax

2010-08-30 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 05:07:10 UTC 2010

Modified Files:
src/bin/pax: ar_io.c

Log Message:
Backout previous; it was wrong fix.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/bin/pax/ar_io.c

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

Modified files:

Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.51 src/bin/pax/ar_io.c:1.52
--- src/bin/pax/ar_io.c:1.51	Tue Aug 31 04:50:07 2010
+++ src/bin/pax/ar_io.c	Tue Aug 31 05:07:09 2010
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)ar_io.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ar_io.c,v 1.51 2010/08/31 04:50:07 enami Exp $);
+__RCSID($NetBSD: ar_io.c,v 1.52 2010/08/31 05:07:09 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -147,13 +147,11 @@
 			syswarn(0, errno, Failed open on %s, name);
 			return -1;
 		}
-#if !HAVE_NBTOOL_CONFIG_H
 		if (!isrmt(arfd)) {
 			rmtclose(arfd);
 			tty_warn(0, Not a remote file: %s, name);
 			return -1;
 		}
-#endif
 		blksz = rdblksz = 8192;
 		lstrval = 1;
 		return 0;



CVS commit: src

2010-08-30 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Aug 31 05:12:35 UTC 2010

Modified Files:
src/include: rmt.h
src/lib/librmt: rmtlib.c

Log Message:
Move prototype of isrmt() to rmt.h.  It is a public interface
described in rmtops(3).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/include/rmt.h
cvs rdiff -u -r1.21 -r1.22 src/lib/librmt/rmtlib.c

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

Modified files:

Index: src/include/rmt.h
diff -u src/include/rmt.h:1.5 src/include/rmt.h:1.6
--- src/include/rmt.h:1.5	Thu Feb  3 04:39:32 2005
+++ src/include/rmt.h	Tue Aug 31 05:12:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmt.h,v 1.5 2005/02/03 04:39:32 perry Exp $	*/
+/*	$NetBSD: rmt.h,v 1.6 2010/08/31 05:12:35 enami Exp $	*/
 
 /*
  *	rmt.h
@@ -20,6 +20,7 @@
 #include sys/cdefs.h
 
 __BEGIN_DECLS
+int	isrmt(int);
 int	rmtaccess(const char *, int);
 int	rmtclose(int);
 int	rmtcreat(const char *, mode_t);

Index: src/lib/librmt/rmtlib.c
diff -u src/lib/librmt/rmtlib.c:1.21 src/lib/librmt/rmtlib.c:1.22
--- src/lib/librmt/rmtlib.c:1.21	Sun Mar 19 23:05:50 2006
+++ src/lib/librmt/rmtlib.c	Tue Aug 31 05:12:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmtlib.c,v 1.21 2006/03/19 23:05:50 christos Exp $	*/
+/*	$NetBSD: rmtlib.c,v 1.22 2010/08/31 05:12:35 enami Exp $	*/
 
 /*
  *	rmt --- remote tape emulator subroutines
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rmtlib.c,v 1.21 2006/03/19 23:05:50 christos Exp $);
+__RCSID($NetBSD: rmtlib.c,v 1.22 2010/08/31 05:12:35 enami Exp $);
 
 #define RMTIOCTL	1
 /* #define USE_REXEC	1 */	/* rexec code courtesy of Dan Kegel, srs!dan */
@@ -71,8 +71,6 @@
 static	void	rmtabort(int);
 static	int	status(int);
 
-	int	isrmt(int);
-
 
 #define BUFMAGIC	64	/* a magic number for buffer sizes */
 #define MAXUNIT		4



CVS commit: src/bin/ls

2010-08-17 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Aug 18 02:53:54 UTC 2010

Modified Files:
src/bin/ls: print.c

Log Message:
Fix broken indentation.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/bin/ls/print.c

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

Modified files:

Index: src/bin/ls/print.c
diff -u src/bin/ls/print.c:1.47 src/bin/ls/print.c:1.48
--- src/bin/ls/print.c:1.47	Fri Apr  2 15:09:12 2010
+++ src/bin/ls/print.c	Wed Aug 18 02:53:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.47 2010/04/02 15:09:12 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.48 2010/08/18 02:53:54 enami Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = @(#)print.c	8.5 (Berkeley) 7/28/94;
 #else
-__RCSID($NetBSD: print.c,v 1.47 2010/04/02 15:09:12 christos Exp $);
+__RCSID($NetBSD: print.c,v 1.48 2010/08/18 02:53:54 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -107,15 +107,15 @@
 		if (f_size) {
 			if (f_humanize) {
 if ((humanize_number(szbuf, sizeof(szbuf),
-	sp-st_blocks * S_BLKSIZE,
-			, HN_AUTOSCALE,
-			(HN_DECIMAL | HN_B | HN_NOSPACE))) == -1)
-err(1, humanize_number);
-			(void)printf(%*s , dp-s_block, szbuf);
+sp-st_blocks * S_BLKSIZE,
+, HN_AUTOSCALE,
+(HN_DECIMAL | HN_B | HN_NOSPACE))) == -1)
+	err(1, humanize_number);
+(void)printf(%*s , dp-s_block, szbuf);
 			} else {
-			(void)printf(%*llu , dp-s_block,
-	(long long)howmany(sp-st_blocks,
-			   	blocksize));
+(void)printf(%*llu , dp-s_block,
+(long long)howmany(sp-st_blocks,
+blocksize));
 			}
 		}
 		(void)strmode(sp-st_mode, buf);



CVS commit: src/distrib/sets/lists/comp

2010-07-25 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Jul 26 02:51:57 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
cat9/vprint.0 is still there.  Salvage the deleted line by previous commit
to fix build breakage.


To generate a diff of this commit:
cvs rdiff -u -r1.1484 -r1.1485 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1484 src/distrib/sets/lists/comp/mi:1.1485
--- src/distrib/sets/lists/comp/mi:1.1484	Sun Jul 25 21:05:14 2010
+++ src/distrib/sets/lists/comp/mi	Mon Jul 26 02:51:57 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1484 2010/07/25 21:05:14 jruoho Exp $
+#	$NetBSD: mi,v 1.1485 2010/07/26 02:51:57 enami Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9920,6 +9920,7 @@
 ./usr/share/man/cat9/vnodeops.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vnsubr.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/voidop.0			comp-sys-catman		.cat
+./usr/share/man/cat9/vprint.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vprintf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vput.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/vrecycle.0			comp-sys-catman		.cat



CVS commit: src/tests/fs/ffs

2010-07-12 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Jul 13 01:42:22 UTC 2010

Modified Files:
src/tests/fs/ffs: t_mount.c

Log Message:
Make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/ffs/t_mount.c

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

Modified files:

Index: src/tests/fs/ffs/t_mount.c
diff -u src/tests/fs/ffs/t_mount.c:1.3 src/tests/fs/ffs/t_mount.c:1.4
--- src/tests/fs/ffs/t_mount.c:1.3	Mon Jul  5 17:12:48 2010
+++ src/tests/fs/ffs/t_mount.c	Tue Jul 13 01:42:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_mount.c,v 1.3 2010/07/05 17:12:48 pooka Exp $	*/
+/*	$NetBSD: t_mount.c,v 1.4 2010/07/13 01:42:21 enami Exp $	*/
 
 /*
  * Adapted for rump and atf from a testcase supplied
@@ -25,19 +25,19 @@
 {
 	void *tmp;
 
-	if (ffs_newfs(tmp, IMGNAME, IMGSIZE) != 0)
+	if (ffs_fstest_newfs(tmp, IMGNAME, IMGSIZE) != 0)
 		atf_tc_fail(newfs failed);
 
 	atf_tc_expect_fail(PR kern/43573);
-	if (ffs_mount(tmp, MNTDIR, 0) != 0) {
+	if (ffs_fstest_mount(tmp, MNTDIR, 0) != 0) {
 		atf_tc_fail(mount failed);
 	}
 	atf_tc_expect_pass();
 
-	if (ffs_unmount(MNTDIR, 0) != 0)
+	if (ffs_fstest_unmount(MNTDIR, 0) != 0)
 		atf_tc_fail(unmount failed);
 
-	if (ffs_delfs(tmp) != 0)
+	if (ffs_fstest_delfs(tmp) != 0)
 		atf_tc_fail(delfs failed);
 }
 



CVS commit: src/usr.bin/netstat

2010-07-09 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Jul  9 07:04:31 UTC 2010

Modified Files:
src/usr.bin/netstat: if.c

Log Message:
Line up total numbers again.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/netstat/if.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/netstat/if.c
diff -u src/usr.bin/netstat/if.c:1.68 src/usr.bin/netstat/if.c:1.69
--- src/usr.bin/netstat/if.c:1.68	Wed Feb 24 11:00:27 2010
+++ src/usr.bin/netstat/if.c	Fri Jul  9 07:04:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.68 2010/02/24 11:00:27 pooka Exp $	*/
+/*	$NetBSD: if.c,v 1.69 2010/07/09 07:04:30 enami Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)if.c	8.2 (Berkeley) 2/21/94;
 #else
-__RCSID($NetBSD: if.c,v 1.68 2010/02/24 11:00:27 pooka Exp $);
+__RCSID($NetBSD: if.c,v 1.69 2010/07/09 07:04:30 enami Exp $);
 #endif
 #endif /* not lint */
 
@@ -869,9 +869,9 @@
 			if (hflag  humanize_number(humbuf,
 			sizeof(humbuf), sum-ift_ib - total-ift_ib, ,
 			HN_AUTOSCALE, HN_NOSPACE | HN_B)  0)
-printf(%10s %8.8s , humbuf,  );
+printf(  %10s %8.8s , humbuf,  );
 			else
-printf(%10llu %8.8s , 
+printf(  %10llu %8.8s , 
 (unsigned long long)
 (sum-ift_ib - total-ift_ib),  );
 



CVS commit: src/share/man/man4

2010-03-14 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar 15 00:47:38 UTC 2010

Modified Files:
src/share/man/man4: uthum.4

Log Message:
Sync SYNOPSIS with the actual configuration file.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/uthum.4

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

Modified files:

Index: src/share/man/man4/uthum.4
diff -u src/share/man/man4/uthum.4:1.3 src/share/man/man4/uthum.4:1.4
--- src/share/man/man4/uthum.4:1.3	Sun Feb  7 18:09:01 2010
+++ src/share/man/man4/uthum.4	Mon Mar 15 00:47:38 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: uthum.4,v 1.3 2010/02/07 18:09:01 tonio Exp $
+.\	$NetBSD: uthum.4,v 1.4 2010/03/15 00:47:38 enami Exp $
 .\	$OpenBSD: uthum.4,v 1.3 2009/11/23 20:53:18 jmc Exp $
 .\
 .\ Copyright (c) 2009 Yojiro UO y...@nui.org
@@ -22,7 +22,7 @@
 .Nm uthum
 .Nd TEMPer and TEMPerHUM USB temperature and humidity sensor
 .Sh SYNOPSIS
-.Cd uthum* at uhidev?
+.Cd uthum* at uhidev? reportid ?
 .Sh DESCRIPTION
 The
 .Nm



CVS commit: src/sys/dev/usb

2010-03-14 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Mar 15 03:27:49 UTC 2010

Modified Files:
src/sys/dev/usb: uyurex.c

Log Message:
The monitor struct member is gone.  Make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/uyurex.c

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/uyurex.c
diff -u src/sys/dev/usb/uyurex.c:1.1 src/sys/dev/usb/uyurex.c:1.2
--- src/sys/dev/usb/uyurex.c:1.1	Thu Mar 11 10:38:37 2010
+++ src/sys/dev/usb/uyurex.c	Mon Mar 15 03:27:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uyurex.c,v 1.1 2010/03/11 10:38:37 enami Exp $ */
+/*	$NetBSD: uyurex.c,v 1.2 2010/03/15 03:27:49 enami Exp $ */
 /*	$OpenBSD: uyurex.c,v 1.3 2010/03/04 03:47:22 deraadt Exp $ */
 
 /*
@@ -165,7 +165,6 @@
 	sc-sc_sensor_val.units = ENVSYS_INTEGER;
 	sc-sc_sensor_val.state = ENVSYS_SINVALID;
 	sc-sc_sensor_val.flags = ENVSYS_FMONCRITICAL;	/* abuse XXX */
-	sc-sc_sensor_val.monitor = true;
 	strlcpy(sc-sc_sensor_val.desc, BBU,
 		sizeof(sc-sc_sensor_val.desc));
 	sysmon_envsys_sensor_attach(sc-sc_sme, sc-sc_sensor_val);



CVS commit: src/sys/dev/usb

2010-03-11 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Mar 11 10:35:22 UTC 2010

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

Log Message:
Add device id of yurex from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.545 -r1.546 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.545 src/sys/dev/usb/usbdevs:1.546
--- src/sys/dev/usb/usbdevs:1.545	Sat Mar  6 20:59:07 2010
+++ src/sys/dev/usb/usbdevs	Thu Mar 11 10:35:22 2010
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.545 2010/03/06 20:59:07 plunky Exp $
+$NetBSD: usbdevs,v 1.546 2010/03/11 10:35:22 enami Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -398,6 +398,7 @@
 vendor AGATE		0x0c08	Agate Technologies
 vendor DMI		0x0c0b	DMI
 vendor CHICONY2		0x0c45	Chicony Electronics
+vendor MICRODIA		0x0c45	Microdia / Sonix Technology Co., Ltd.
 vendor SEALEVEL		0x0c52	Sealevel System
 vendor LUWEN		0x0c76	EasyDisk
 vendor QUALCOMM_K	0x0c88	Qualcomm Kyocera
@@ -1586,6 +1587,9 @@
 product MICROCHIP PICKIT1	0x0032	PICkit(TM) 1 FLASH Starter Kit
 product MICROCHIP PICKIT2	0x0033	PICkit 2 Microcontroller Programmer
 
+/* Microdia / Sonix Techonology Co., Ltd. products */
+product MICRODIA YUREX		0x1010	YUREX
+
 /* Micronet Communications products */
 product MICRONET SP128AR	0x0003	SP128AR EtherFast
 



CVS commit: src/usr.bin/sort

2010-02-05 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Feb  5 21:58:42 UTC 2010

Modified Files:
src/usr.bin/sort: fsort.c msort.c sort.c sort.h

Log Message:
Don't touch past the end of allocated region.  It results segmentation
violation.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/sort/fsort.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/sort/msort.c
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/sort/sort.c
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/sort/sort.h

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/sort/fsort.c
diff -u src/usr.bin/sort/fsort.c:1.46 src/usr.bin/sort/fsort.c:1.47
--- src/usr.bin/sort/fsort.c:1.46	Fri Nov  6 18:34:22 2009
+++ src/usr.bin/sort/fsort.c	Fri Feb  5 21:58:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsort.c,v 1.46 2009/11/06 18:34:22 joerg Exp $	*/
+/*	$NetBSD: fsort.c,v 1.47 2010/02/05 21:58:41 enami Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 #include sort.h
 #include fsort.h
 
-__RCSID($NetBSD: fsort.c,v 1.46 2009/11/06 18:34:22 joerg Exp $);
+__RCSID($NetBSD: fsort.c,v 1.47 2010/02/05 21:58:41 enami Exp $);
 
 #include stdlib.h
 #include string.h
@@ -95,7 +95,7 @@
 	int file_no;
 	int max_recs = DEBUG('m') ? 16 : MAXNUM;
 
-	buffer = malloc(bufsize);
+	buffer = allocrec(NULL, bufsize);
 	bufend = (u_char *)buffer + bufsize;
 	/* Allocate double length keymap for radix_sort */
 	keylist = malloc(2 * max_recs * sizeof(*keylist));
@@ -154,7 +154,7 @@
 			/* c == BUFFEND, and we can process more data */
 			/* Allocate a larger buffer for this lot of data */
 			bufsize *= 2;
-			nbuffer = realloc(buffer, bufsize);
+			nbuffer = allocrec(buffer, bufsize);
 			if (!nbuffer) {
 err(2, failed to realloc buffer to %zu bytes,
 	bufsize);

Index: src/usr.bin/sort/msort.c
diff -u src/usr.bin/sort/msort.c:1.29 src/usr.bin/sort/msort.c:1.30
--- src/usr.bin/sort/msort.c:1.29	Fri Nov  6 18:34:22 2009
+++ src/usr.bin/sort/msort.c	Fri Feb  5 21:58:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msort.c,v 1.29 2009/11/06 18:34:22 joerg Exp $	*/
+/*	$NetBSD: msort.c,v 1.30 2010/02/05 21:58:42 enami Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
 #include sort.h
 #include fsort.h
 
-__RCSID($NetBSD: msort.c,v 1.29 2009/11/06 18:34:22 joerg Exp $);
+__RCSID($NetBSD: msort.c,v 1.30 2010/02/05 21:58:42 enami Exp $);
 
 #include stdlib.h
 #include string.h
@@ -206,7 +206,7 @@
 	for (nfiles = i = 0; i  fstack_count; i++) {
 		cfile = fstack[i];
 		if (cfile-rec == NULL) {
-			cfile-rec = emalloc(DEFLLEN);
+			cfile-rec = allocrec(NULL, DEFLLEN);
 			cfile-end = (u_char *)cfile-rec + DEFLLEN;
 		}
 		rewind(cfile-fp);
@@ -219,7 +219,7 @@
 			if (c == BUFFEND) {
 /* Double buffer size */
 sz = (cfile-end - (u_char *)cfile-rec) * 2;
-cfile-rec = erealloc(cfile-rec, sz);
+cfile-rec = allocrec(cfile-rec, sz);
 cfile-end = (u_char *)cfile-rec + sz;
 continue;
 			}
@@ -245,7 +245,7 @@
 	 * output file - maintaining one record from each file in the sorted
 	 * list.
 	 */
-	new_rec = emalloc(DEFLLEN);
+	new_rec = allocrec(NULL, DEFLLEN);
 	new_end = (u_char *)new_rec + DEFLLEN;
 	for (;;) {
 		cfile = flist[0];
@@ -263,7 +263,7 @@
 		if (c == BUFFEND) {
 			/* Buffer not large enough - double in size */
 			sz = (new_end - (u_char *)new_rec) * 2;
-			new_rec = erealloc(new_rec, sz);
+			new_rec = allocrec(new_rec, sz);
 			new_end = (u_char *)new_rec +sz;
 			continue;
 		}

Index: src/usr.bin/sort/sort.c
diff -u src/usr.bin/sort/sort.c:1.57 src/usr.bin/sort/sort.c:1.58
--- src/usr.bin/sort/sort.c:1.57	Fri Nov  6 18:34:22 2009
+++ src/usr.bin/sort/sort.c	Fri Feb  5 21:58:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sort.c,v 1.57 2009/11/06 18:34:22 joerg Exp $	*/
+/*	$NetBSD: sort.c,v 1.58 2010/02/05 21:58:42 enami Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  The Regents of the University of California.  All rights reserved.);
 #endif /* not lint */
 
-__RCSID($NetBSD: sort.c,v 1.57 2009/11/06 18:34:22 joerg Exp $);
+__RCSID($NetBSD: sort.c,v 1.58 2010/02/05 21:58:42 enami Exp $);
 
 #include sys/types.h
 #include sys/time.h
@@ -402,3 +402,10 @@
 	 [-t char] [file ...]\n);
 	exit(2);
 }
+
+RECHEADER *
+allocrec(RECHEADER *rec, size_t size)
+{
+
+	return (erealloc(rec, size + sizeof(long) - 1));
+}

Index: src/usr.bin/sort/sort.h
diff -u src/usr.bin/sort/sort.h:1.30 src/usr.bin/sort/sort.h:1.31
--- src/usr.bin/sort/sort.h:1.30	Mon Sep 28 20:30:01 2009
+++ src/usr.bin/sort/sort.h	Fri Feb  5 21:58:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sort.h,v 1.30 2009/09/28 20:30:01 dsl Exp $	*/
+/*	$NetBSD: sort.h,v 1.31 2010/02/05 21:58:42 enami Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -174,6 +174,7 @@
 #define DEBUG(ch) (debug_flags  (1  ((ch)  31)))
 extern unsigned int debug_flags;
 

CVS commit: src/lib/libc/locale

2009-12-14 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Dec 15 00:35:36 UTC 2009

Modified Files:
src/lib/libc/locale: nl_langinfo.3

Log Message:
Put space after comma in the C code example.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/nl_langinfo.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/libc/locale/nl_langinfo.3
diff -u src/lib/libc/locale/nl_langinfo.3:1.17 src/lib/libc/locale/nl_langinfo.3:1.18
--- src/lib/libc/locale/nl_langinfo.3:1.17	Thu Mar 12 12:50:31 2009
+++ src/lib/libc/locale/nl_langinfo.3	Tue Dec 15 00:35:36 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: nl_langinfo.3,v 1.17 2009/03/12 12:50:31 joerg Exp $
+.\	$NetBSD: nl_langinfo.3,v 1.18 2009/12/15 00:35:36 enami Exp $
 .\
 .\ Written by J.T. Conklin j...@netbsd.org.
 .\ Public domain.
@@ -113,7 +113,7 @@
 	(void)setlocale(LC_ALL, );
 	ptr = nl_langinfo(D_T_FMT);
 	strftime(datestring, sizeof(datestring), ptr, tm);
-	printf(%s\en,datestring);
+	printf(%s\en, datestring);
 	return (0);
 }
 .Ed



CVS commit: src/sys/dev/mii

2009-12-13 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Mon Dec 14 01:48:34 UTC 2009

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen so that makphy.c compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.82 -r1.83 src/sys/dev/mii/miidevs_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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.92 src/sys/dev/mii/miidevs.h:1.93
--- src/sys/dev/mii/miidevs.h:1.92	Wed Nov 18 23:01:47 2009
+++ src/sys/dev/mii/miidevs.h	Mon Dec 14 01:48:34 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.92 2009/11/18 23:01:47 bouyer Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.93 2009/12/14 01:48:34 enami Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.90 2009/11/18 23:00:46 bouyer Exp
+ *	NetBSD: miidevs,v 1.91 2009/12/13 19:20:17 matt Exp
  */
 
 /*-
@@ -311,6 +311,8 @@
 #define	MII_STR_xxMARVELL_E1000_5	Marvell 88E1000 Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E6060	0x0008
 #define	MII_STR_xxMARVELL_E6060	Marvell 88E6060 10/100 5-port PHY switch
+#define	MII_MODEL_xxMARVELL_E1149	0x000b
+#define	MII_STR_xxMARVELL_E1149	Marvell 88E1149 Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E	0x000c
 #define	MII_STR_xxMARVELL_E	Marvell 88E Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E1116	0x0021

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.82 src/sys/dev/mii/miidevs_data.h:1.83
--- src/sys/dev/mii/miidevs_data.h:1.82	Wed Nov 18 23:01:47 2009
+++ src/sys/dev/mii/miidevs_data.h	Mon Dec 14 01:48:34 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.82 2009/11/18 23:01:47 bouyer Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.83 2009/12/14 01:48:34 enami Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.90 2009/11/18 23:00:46 bouyer Exp
+ *	NetBSD: miidevs,v 1.91 2009/12/13 19:20:17 matt Exp
  */
 
 /*-
@@ -118,6 +118,7 @@
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1000_3, MII_STR_xxMARVELL_E1000_3 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1000_5, MII_STR_xxMARVELL_E1000_5 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E6060, MII_STR_xxMARVELL_E6060 },
+ { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1149, MII_STR_xxMARVELL_E1149 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E, MII_STR_xxMARVELL_E },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1116, MII_STR_xxMARVELL_E1116 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1116R, MII_STR_xxMARVELL_E1116R },



CVS commit: src/lib/libc/stdlib

2009-12-02 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Wed Dec  2 09:34:51 UTC 2009

Modified Files:
src/lib/libc/stdlib: setenv.c

Log Message:
Retain old variables when failed to allocate memory.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/stdlib/setenv.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/libc/stdlib/setenv.c
diff -u src/lib/libc/stdlib/setenv.c:1.31 src/lib/libc/stdlib/setenv.c:1.32
--- src/lib/libc/stdlib/setenv.c:1.31	Sat Nov  1 00:54:47 2008
+++ src/lib/libc/stdlib/setenv.c	Wed Dec  2 09:34:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: setenv.c,v 1.31 2008/11/01 00:54:47 christos Exp $	*/
+/*	$NetBSD: setenv.c,v 1.32 2009/12/02 09:34:51 enami Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)setenv.c	8.1 (Berkeley) 6/4/93;
 #else
-__RCSID($NetBSD: setenv.c,v 1.31 2008/11/01 00:54:47 christos Exp $);
+__RCSID($NetBSD: setenv.c,v 1.32 2009/12/02 09:34:51 enami Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -103,9 +103,9 @@
 		continue;
 	size = cc - name;
 	/* name + `=' + value */
-	if ((environ[offset] = malloc(size + l_value + 2)) == NULL)
+	if ((c = malloc(size + l_value + 2)) == NULL)
 		goto bad;
-	c = environ[offset];
+	environ[offset] = c;
 	(void)memcpy(c, name, size);
 	c += size;
 	*c++ = '=';



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

2009-11-27 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Nov 27 12:37:19 UTC 2009

Modified Files:
src/external/bsd/byacc/dist: skeleton.c

Log Message:
The expression (yyvs != 0) is always true and not a necessary test
in the first place since realloc(NULL, size) is equivalent to
malloc(size).  Write code straightforward while i'm here.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/byacc/dist/skeleton.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/byacc/dist/skeleton.c
diff -u src/external/bsd/byacc/dist/skeleton.c:1.5 src/external/bsd/byacc/dist/skeleton.c:1.6
--- src/external/bsd/byacc/dist/skeleton.c:1.5	Thu Oct 29 21:03:59 2009
+++ src/external/bsd/byacc/dist/skeleton.c	Fri Nov 27 12:37:19 2009
@@ -1,10 +1,10 @@
-/*	$NetBSD: skeleton.c,v 1.5 2009/10/29 21:03:59 christos Exp $	*/
+/*	$NetBSD: skeleton.c,v 1.6 2009/11/27 12:37:19 enami Exp $	*/
 /* Id: skeleton.c,v 1.19 2008/12/24 14:52:28 tom Exp */
 
 #include defs.h
 
 #include sys/cdefs.h
-__RCSID($NetBSD: skeleton.c,v 1.5 2009/10/29 21:03:59 christos Exp $);
+__RCSID($NetBSD: skeleton.c,v 1.6 2009/11/27 12:37:19 enami Exp $);
 
 /*  The definition of yysccsid in the banner should be replaced with	*/
 /*  a #pragma ident directive if the target C compiler supports		*/
@@ -115,17 +115,13 @@
 newsize = YYMAXDEPTH;,
 ,
 i = *yyssp - *yyss;,
-newss = (*yyss != 0),
-  ? (short *)realloc(*yyss, newsize * sizeof(*newss)),
-  : (short *)malloc(newsize * sizeof(*newss));,
+newss = (short *)realloc(*yyss, newsize * sizeof(*newss));,
 if (newss == 0),
 return -1;,
 ,
 *yyss  = newss;,
 *yyssp = newss + i;,
-newvs = (yyvs != 0),
-  ? (YYSTYPE *)realloc(*yyvs, newsize * sizeof(*newvs)),
-  : (YYSTYPE *)malloc(newsize * sizeof(*newvs));,
+newvs = (YYSTYPE *)realloc(*yyvs, newsize * sizeof(*newvs));,
 if (newvs == 0),
 return -1;,
 ,
@@ -171,12 +167,10 @@
 yystate = 0;,
 ,
 yystacksize = 0;,
-yyvs = NULL;,
-yyss = NULL;,
+yyvs = yyvsp = NULL;,
+yyss = yyssp = NULL;,
 if (yygrowstack(yyss, yyssp, yysslim, yyvs, yyvsp, yystacksize)),
 goto yyoverflow;,
-yyssp = yyss;,
-yyvsp = yyvs;,
 yystate = 0;,
 *yyssp = 0;,
 ,



CVS commit: src/gnu/dist/gdb6/gdb

2009-11-26 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Nov 27 02:51:15 UTC 2009

Modified Files:
src/gnu/dist/gdb6/gdb: bsd-kvm.c

Log Message:
Lookup lwp0.l_addr instead of proc0paddr to locate PCB.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/gnu/dist/gdb6/gdb/bsd-kvm.c

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

Modified files:

Index: src/gnu/dist/gdb6/gdb/bsd-kvm.c
diff -u src/gnu/dist/gdb6/gdb/bsd-kvm.c:1.3 src/gnu/dist/gdb6/gdb/bsd-kvm.c:1.4
--- src/gnu/dist/gdb6/gdb/bsd-kvm.c:1.3	Sun Jul  2 21:04:40 2006
+++ src/gnu/dist/gdb6/gdb/bsd-kvm.c	Fri Nov 27 02:51:15 2009
@@ -211,6 +211,27 @@
   return;
 }
 
+#if 1 /* TODO: HAVE_STRUCT_LWP_L_ADDR */
+  memset (nl, 0, sizeof nl);
+  nl[0].n_name = _lwp0;
+
+  if (kvm_nlist (core_kd, nl) == -1)
+error ((%s), kvm_geterr (core_kd));
+
+  if (nl[0].n_value != 0)
+{
+  struct pcb *paddr;
+
+  /* Found lwp0.  */
+  nl[0].n_value += offsetof (struct lwp, l_addr);
+  if (kvm_read (core_kd, nl[0].n_value, paddr, sizeof paddr) == -1)
+	error ((%s), kvm_geterr (core_kd));
+
+  bsd_kvm_fetch_pcb (paddr);
+  return;
+}
+#endif
+
 #ifdef HAVE_STRUCT_THREAD_TD_PCB
   /* In FreeBSD kernels for 5.0-RELEASE and later, the PCB no longer
  lives in `struct proc' but in `struct thread'.  The `struct



CVS commit: src/sys/kern

2009-11-18 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Nov 19 02:59:34 UTC 2009

Modified Files:
src/sys/kern: vfs_subr.c

Log Message:
Add missing vfs_unbusy() call in error path of sysctl_kern_vnode().
This allows us to reboot machine successfully even if pstat -v fails once.


To generate a diff of this commit:
cvs rdiff -u -r1.387 -r1.388 src/sys/kern/vfs_subr.c

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

Modified files:

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.387 src/sys/kern/vfs_subr.c:1.388
--- src/sys/kern/vfs_subr.c:1.387	Tue Nov 17 22:20:14 2009
+++ src/sys/kern/vfs_subr.c	Thu Nov 19 02:59:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.387 2009/11/17 22:20:14 bouyer Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.388 2009/11/19 02:59:33 enami Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.387 2009/11/17 22:20:14 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.388 2009/11/19 02:59:33 enami Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -2208,6 +2208,7 @@
 (void)vunmark(mvp);
 mutex_exit(mntvnode_lock);
 vnfree(mvp);
+vfs_unbusy(mp, false, NULL);
 sysctl_relock();
 *sizep = bp - where;
 return (ENOMEM);
@@ -2220,6 +2221,7 @@
 (void)vunmark(mvp);
 mutex_exit(mntvnode_lock);
 vnfree(mvp);
+vfs_unbusy(mp, false, NULL);
 sysctl_relock();
 return (error);
 			}



CVS commit: src/sys/kern

2009-11-18 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Thu Nov 19 03:01:06 UTC 2009

Modified Files:
src/sys/kern: vfs_subr.c

Log Message:
Fix indentation, wrap long line and remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.388 -r1.389 src/sys/kern/vfs_subr.c

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

Modified files:

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.388 src/sys/kern/vfs_subr.c:1.389
--- src/sys/kern/vfs_subr.c:1.388	Thu Nov 19 02:59:33 2009
+++ src/sys/kern/vfs_subr.c	Thu Nov 19 03:01:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.388 2009/11/19 02:59:33 enami Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.389 2009/11/19 03:01:05 enami Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.388 2009/11/19 02:59:33 enami Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_subr.c,v 1.389 2009/11/19 03:01:05 enami Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -2165,7 +2165,7 @@
 	size_t *sizep = oldlenp;
 	struct mount *mp, *nmp;
 	vnode_t *vp, *mvp, vbuf;
-	char *bp = where, *savebp;
+	char *bp = where;
 	char *ewhere;
 	int error;
 
@@ -2185,17 +2185,17 @@
 	sysctl_unlock();
 	mutex_enter(mountlist_lock);
 	for (mp = CIRCLEQ_FIRST(mountlist); mp != (void *)mountlist;
-	 mp = nmp) {
+	mp = nmp) {
 		if (vfs_busy(mp, nmp)) {
 			continue;
 		}
-		savebp = bp;
 		/* Allocate a marker vnode. */
 		mvp = vnalloc(mp);
 		/* Should never fail for mp != NULL */
 		KASSERT(mvp != NULL);
 		mutex_enter(mntvnode_lock);
-		for (vp = TAILQ_FIRST(mp-mnt_vnodelist); vp; vp = vunmark(mvp)) {
+		for (vp = TAILQ_FIRST(mp-mnt_vnodelist); vp;
+		vp = vunmark(mvp)) {
 			vmark(mvp, vp);
 			/*
 			 * Check that the vp is still associated with
@@ -2216,7 +2216,7 @@
 			memcpy(vbuf, vp, VNODESZ);
 			mutex_exit(mntvnode_lock);
 			if ((error = copyout(vp, bp, VPTRSZ)) ||
-			   (error = copyout(vbuf, bp + VPTRSZ, VNODESZ))) {
+			(error = copyout(vbuf, bp + VPTRSZ, VNODESZ))) {
 			   	mutex_enter(mntvnode_lock);
 (void)vunmark(mvp);
 mutex_exit(mntvnode_lock);



CVS commit: src/sys/dev/usb

2009-10-15 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Fri Oct 16 00:45:26 UTC 2009

Modified Files:
src/sys/dev/usb: ohci.c

Log Message:
Since the aprint_normal_dev() several lines above prints a space
after the device name, no need to prepend the space here.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/dev/usb/ohci.c

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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.199 src/sys/dev/usb/ohci.c:1.200
--- src/sys/dev/usb/ohci.c:1.199	Tue Sep  1 21:46:07 2009
+++ src/sys/dev/usb/ohci.c	Fri Oct 16 00:45:26 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.199 2009/09/01 21:46:07 jmcneill Exp $	*/
+/*	$NetBSD: ohci.c,v 1.200 2009/10/16 00:45:26 enami Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.199 2009/09/01 21:46:07 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.200 2009/10/16 00:45:26 enami Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -701,7 +701,7 @@
 	SIMPLEQ_INIT(sc-sc_free_xfers);
 
 	rev = OREAD4(sc, OHCI_REVISION);
-	aprint_normal( OHCI version %d.%d%s\n,
+	aprint_normal(OHCI version %d.%d%s\n,
 	OHCI_REV_HI(rev), OHCI_REV_LO(rev),
 	OHCI_REV_LEGACY(rev) ? , legacy support : );
 



  1   2   >