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/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.



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/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.



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 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.




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.



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

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.



CVS commit: src/sys/dev/pci

2015-02-17 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue Feb 17 23:07:56 UTC 2015

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
Make this file compiles again with BGE_DEBUG defined.


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/dev/pci/if_bge.c

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



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

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.



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/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.



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.



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-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.



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/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.



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.



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/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.



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/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.



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.



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.



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/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.



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/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.



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/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.



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/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.



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/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.



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/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.



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.



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/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.



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/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.



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-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.



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.



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.



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/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.



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/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.



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/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.



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/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.



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.



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/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.



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/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.



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-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.



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/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.



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/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.



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/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.



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/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.



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.



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/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.



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/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.



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/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.



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/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.



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

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.



Re: CVS commit: src/usr.bin/grep

2011-02-16 Thread enami tsugutomo
Joerg Sonnenberger jo...@netbsd.org writes:

 Module Name:  src
 Committed By: joerg
 Date: Wed Feb 16 01:31:34 UTC 2011
 
 Modified Files:
   src/usr.bin/grep: Makefile file.c grep.1 grep.c grep.h queue.c util.c
 Added Files:
   src/usr.bin/grep: fastgrep.c

I just did `more fastgrep.c' and found following piece of code.  The
usage of wflag is an obvious regression from OpenBSD code.

|   if (fg-len = 14 
|   strncmp(pat + (fg-bol ? 1 : 0), [[::]], 7) == 0 
|   strncmp(pat + (fg-bol ? 1 : 0) + fg-len - 7, [[::]], 7) == 0) {
|   fg-len -= 14;
|   /* Word boundary is handled separately in util.c */
|   wflag = true;
|   }
|
|   /*
|* Copy pattern minus '^' and '$' characters as well as word
|* match character classes at the beginning and ending of the
|* string respectively.
|*/
|   fg-pattern = grep_malloc(fg-len + 1);
|   strlcpy((char *)fg-pattern, pat + (bol ? 1 : 0) + wflag,
|   fg-len + 1);

enami.


Re: CVS commit: src/usr.bin/grep

2011-02-16 Thread enami tsugutomo
 In which sense?

The meaning of `... + wflag' was to skip 7 chars.

enami.


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/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.



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.



  1   2   3   >