Fix whitespace usage.
This commit is contained in:
parent
e8f9e7f005
commit
4d34b523bc
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: ktrace.c,v 1.30 2004/01/05 23:23:34 jmmv Exp $ */
|
/* $NetBSD: ktrace.c,v 1.31 2004/02/28 01:37:56 enami Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1988, 1993
|
* Copyright (c) 1988, 1993
|
||||||
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
|
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: ktrace.c,v 1.30 2004/01/05 23:23:34 jmmv Exp $");
|
__RCSID("$NetBSD: ktrace.c,v 1.31 2004/02/28 01:37:56 enami Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ main(argc, argv)
|
|||||||
outfile = DEF_TRACEFILE;
|
outfile = DEF_TRACEFILE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((ch = getopt(argc,argv, OPTIONS)) != -1)
|
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||||
switch((char)ch) {
|
switch ((char)ch) {
|
||||||
case 'a':
|
case 'a':
|
||||||
append = 1;
|
append = 1;
|
||||||
break;
|
break;
|
||||||
@ -255,12 +255,13 @@ rpid(p)
|
|||||||
warnx("illegal process id.");
|
warnx("illegal process id.");
|
||||||
usage();
|
usage();
|
||||||
}
|
}
|
||||||
return(atoi(p));
|
return (atoi(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef KTRUSS
|
#ifdef KTRUSS
|
||||||
# define LONG_OPTION "[-e emulation] [-m maxdata] [-o outfile] "
|
# define LONG_OPTION "[-e emulation] [-m maxdata] [-o outfile] "
|
||||||
# define SHRT_OPTION "RT"
|
# define SHRT_OPTION "RT"
|
||||||
@ -282,6 +283,7 @@ void
|
|||||||
no_ktrace(sig)
|
no_ktrace(sig)
|
||||||
int sig;
|
int sig;
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ktracefile)
|
if (ktracefile)
|
||||||
(void)unlink(ktracefile);
|
(void)unlink(ktracefile);
|
||||||
(void)errx(1, "ktrace(2) system call not supported in the running"
|
(void)errx(1, "ktrace(2) system call not supported in the running"
|
||||||
@ -302,8 +304,8 @@ do_ktrace(tracefile, ops, trpoints, pid)
|
|||||||
|
|
||||||
if (pipe(pi) < 0)
|
if (pipe(pi) < 0)
|
||||||
err(1, "pipe(2)");
|
err(1, "pipe(2)");
|
||||||
fcntl(pi[0], F_SETFD, FD_CLOEXEC|fcntl(pi[0], F_GETFD, 0));
|
fcntl(pi[0], F_SETFD, FD_CLOEXEC | fcntl(pi[0], F_GETFD, 0));
|
||||||
fcntl(pi[1], F_SETFD, FD_CLOEXEC|fcntl(pi[1], F_GETFD, 0));
|
fcntl(pi[1], F_SETFD, FD_CLOEXEC | fcntl(pi[1], F_GETFD, 0));
|
||||||
|
|
||||||
dofork = (pid == getpid());
|
dofork = (pid == getpid());
|
||||||
|
|
||||||
@ -340,7 +342,8 @@ do_ktrace(tracefile, ops, trpoints, pid)
|
|||||||
char buf[512];
|
char buf[512];
|
||||||
int n, cnt = 0;
|
int n, cnt = 0;
|
||||||
|
|
||||||
while ((n = read(pi[0], buf, sizeof(buf)))>0) {
|
while ((n =
|
||||||
|
read(pi[0], buf, sizeof(buf))) > 0) {
|
||||||
write(1, buf, n);
|
write(1, buf, n);
|
||||||
cnt += n;
|
cnt += n;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user