diff options
author | phk <phk@FreeBSD.org> | 1999-07-10 06:27:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-07-10 06:27:36 +0000 |
commit | 0c64553e0f5d7cc0e11915bcb244010ed4b52de5 (patch) | |
tree | 519f77f10c84b63287f6b7143a43e5e6d69f1146 /sys | |
parent | aed1b7655126729facf9a47ca2ac99bdecf63369 (diff) | |
download | FreeBSD-src-0c64553e0f5d7cc0e11915bcb244010ed4b52de5.zip FreeBSD-src-0c64553e0f5d7cc0e11915bcb244010ed4b52de5.tar.gz |
Fix a dev_t/udev_t issue with accounting. lastcomm now shows the
right tty again.
Submitted by: "D. Rock" <rock@dead-end.net>
Reviewed by: phk
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_acct.c | 6 | ||||
-rw-r--r-- | sys/sys/acct.h | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 61e49ab..f76c2e2 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 - * $Id: kern_acct.c,v 1.19 1998/06/05 21:44:19 dg Exp $ + * $Id: kern_acct.c,v 1.20 1999/04/27 11:15:53 phk Exp $ */ #include <sys/param.h> @@ -221,9 +221,9 @@ acct_process(p) /* (7) The terminal from which the process was started */ if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp) - acct.ac_tty = p->p_pgrp->pg_session->s_ttyp->t_dev; + acct.ac_tty = dev2udev(p->p_pgrp->pg_session->s_ttyp->t_dev); else - acct.ac_tty = NODEV; + acct.ac_tty = NOUDEV; /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flag = p->p_acflag; diff --git a/sys/sys/acct.h b/sys/sys/acct.h index ddaef2d..e38675d 100644 --- a/sys/sys/acct.h +++ b/sys/sys/acct.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)acct.h 8.4 (Berkeley) 1/9/95 - * $Id: acct.h,v 1.8 1997/02/22 09:44:48 peter Exp $ + * $Id: acct.h,v 1.9 1998/02/01 20:08:35 bde Exp $ */ #ifndef _SYS_ACCT_H_ @@ -49,6 +49,12 @@ */ typedef u_int16_t comp_t; +#ifdef KERNEL +#define __dev_t udev_t +#else +#define __dev_t dev_t +#endif + #define AC_COMM_LEN 16 struct acct { char ac_comm[AC_COMM_LEN]; /* command name */ @@ -60,7 +66,7 @@ struct acct { gid_t ac_gid; /* group id */ u_int16_t ac_mem; /* average memory usage */ comp_t ac_io; /* count of IO blocks */ - dev_t ac_tty; /* controlling tty */ + __dev_t ac_tty; /* controlling tty */ #define AFORK 0x01 /* forked but not exec'ed */ #define ASU 0x02 /* used super-user permissions */ @@ -69,6 +75,7 @@ struct acct { #define AXSIG 0x10 /* killed by a signal */ u_int8_t ac_flag; /* accounting flags */ }; +#undef __dev_t /* * 1/AHZ is the granularity of the data encoded in the comp_t fields. |