From 888532c46611f535884d111387cb40d1ab1e2c74 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Sun, 18 May 2008 10:42:59 +0000 Subject: [PATCH] sync with WEGA 3.2 kernel --- WEGA/src/uts/sys/acct.c | 104 +++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/WEGA/src/uts/sys/acct.c b/WEGA/src/uts/sys/acct.c index 759abba..a73973a 100644 --- a/WEGA/src/uts/sys/acct.c +++ b/WEGA/src/uts/sys/acct.c @@ -13,7 +13,7 @@ ******************************************************************************* ******************************************************************************/ -char acctwstr[] = "@[$]acct.c Rev : 4.1 08/27/83 11:53:34"; +char whatstr[] = "@[$]acct.c Rev : 4.1 08/27/83 11:53:34"; #include @@ -39,67 +39,71 @@ sysacct() } *uap; uap = (struct a *)u.u_ap; - if (suser()) { - if((!u.u_segmented && ((long)uap->fname==(USEGW << 16))) || - ( u.u_segmented && (uap->fname==NULL))) { - if (acctp) { - plock(acctp); - iput(acctp); - acctp = NULL; - } - return; - } + if (!suser()) + return; + if((!u.u_segmented && ((long)uap->fname==(USEGW << 16))) || + ( u.u_segmented && (uap->fname==NULL))) { if (acctp) { - u.u_error = EBUSY; - return; + plock(acctp); + iput(acctp); + acctp = NULL; } - ip = namei(uchar, 0); - if(ip == NULL) - return; - if((ip->i_mode & IFMT) != IFREG) { - u.u_error = EACCES; - iput(ip); - return; - } - acctp = ip; - prele(ip); + return; } + if (acctp) { + u.u_error = EBUSY; + return; + } + ip = namei(uchar, 0); + if(ip == NULL) + return; + if((ip->i_mode & IFMT) != IFREG) { + u.u_error = EACCES; + iput(ip); + return; + } + acctp = ip; + prele(ip); } /* * On exit, write a record on the accounting file. */ -acct() +acct(st) { register struct inode *ip; - register int i; off_t siz; + int i; - if ((ip=acctp)) { - plock(ip); - for (i=0; ii_size; - u.u_offset = siz; - u.u_base.l = (caddr_t)&acctbuf; - u.u_count = sizeof(acctbuf); - u.u_segflg = 1; - u.u_error = 0; - writei(ip); - if(u.u_error) - ip->i_size = siz; - prele(ip); - } + if ((ip=acctp)==NULL) + return; + plock(ip); + for (i=0; ii_size; + u.u_offset = siz; + u.u_base.l = (caddr_t)&acctbuf; + u.u_count = sizeof(acctbuf); + u.u_segflg = 1; + u.u_error = 0; + u.u_limit = (daddr_t)5000; + writei(ip); + u.u_segflg = 0; + if(u.u_error) + ip->i_size = siz; + prele(ip); } /*