This commit is contained in:
parent
f56221b1b0
commit
b84edfcf52
@ -1,14 +1,17 @@
|
|||||||
--- lastcomm.c
|
--- lastcomm.c
|
||||||
+++ lastcomm.c
|
+++ lastcomm.c
|
||||||
@@ -47,6 +47,7 @@
|
@@ -48,6 +48,10 @@
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
+#include <unistd.h>
|
|
||||||
|
|
||||||
|
+#ifdef HAVE_UNISTD_H
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "uid_hash.h"
|
#include "uid_hash.h"
|
||||||
@@ -65,7 +66,7 @@
|
#include "dev_hash.h"
|
||||||
|
@@ -65,7 +69,7 @@
|
||||||
int strict_match_flag = 0; /* Nonzero if each record has to match
|
int strict_match_flag = 0; /* Nonzero if each record has to match
|
||||||
all items on the command line */
|
all items on the command line */
|
||||||
int print_controls = 0; /* don't print control characters */
|
int print_controls = 0; /* don't print control characters */
|
||||||
@ -17,25 +20,29 @@
|
|||||||
|
|
||||||
char *program_name; /* name of the program, for usage & errs */
|
char *program_name; /* name of the program, for usage & errs */
|
||||||
|
|
||||||
@@ -91,6 +92,10 @@
|
@@ -88,7 +92,6 @@
|
||||||
|
int get_entry PARAMS((struct acct **));
|
||||||
|
int desired_entry PARAMS((char *, char *, char *));
|
||||||
|
|
||||||
|
-
|
||||||
/* code */
|
/* code */
|
||||||
|
|
||||||
+#ifndef HZ
|
|
||||||
+# define AHZ sysconf(_SC_CLK_TCK)
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
void
|
void
|
||||||
main (int argc, char *argv[])
|
@@ -288,6 +291,14 @@
|
||||||
|
print_pacct_record (rec, stddebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (!ahz) // if this is the first cycle run, ahz is not set yet
|
||||||
|
+ {
|
||||||
|
+ if (rec->ac_version == 3)
|
||||||
|
+ ahz = 100; // value AHZ = 100 is hardcoded in acct.h, but in #ifdef __KERNEL__ block. too bad
|
||||||
|
+ else
|
||||||
|
+ ahz = sysconf(_SC_CLK_TCK);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (desired_entry (this_uid, this_dev, rec->ac_comm))
|
||||||
{
|
{
|
||||||
@@ -98,6 +103,7 @@
|
#ifdef HAVE_COMP_T
|
||||||
int other_pacct_file_specified = 0; /* nonzero if the user used the
|
|
||||||
`-f' or `--file' flag */
|
|
||||||
|
|
||||||
+ ahz = AHZ;
|
|
||||||
program_name = argv[0];
|
|
||||||
|
|
||||||
/* Tell the pacct reader that we want to do things backwards! */
|
|
||||||
--- sa.c
|
--- sa.c
|
||||||
+++ sa.c
|
+++ sa.c
|
||||||
@@ -174,7 +174,7 @@
|
@@ -174,7 +174,7 @@
|
||||||
@ -47,20 +54,30 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME)
|
#if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME)
|
||||||
@@ -265,11 +265,16 @@
|
@@ -262,7 +262,6 @@
|
||||||
|
int ask_if_junkable PARAMS((char *, int));
|
||||||
|
|
||||||
|
|
||||||
|
-
|
||||||
/* code */
|
/* code */
|
||||||
|
|
||||||
+#ifndef HZ
|
|
||||||
+# define AHZ sysconf(_SC_CLK_TCK)
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
void
|
void
|
||||||
main (int argc, char *argv[])
|
@@ -1116,6 +1115,18 @@
|
||||||
|
/* loop while there are entries to be had */
|
||||||
|
while ((rec = pacct_get_entry ()) != NULL)
|
||||||
{
|
{
|
||||||
int c;
|
+ if (!ahz) // if this is the first cycle run, ahz is not set yet
|
||||||
|
+ {
|
||||||
+ ahz = AHZ;
|
+ if (rec->ac_version == 3)
|
||||||
program_name = argv[0];
|
+ ahz = 100; // value AHZ = 100 is hardcoded in acct.h, but in #ifdef __KERNEL__ block. too bad
|
||||||
|
+ else
|
||||||
/* Cache the page size of the machine for the PAGES_TO_KB macro */
|
+ ahz = sysconf(_SC_CLK_TCK);
|
||||||
|
+
|
||||||
|
+ if (debugging_enabled)
|
||||||
|
+ {
|
||||||
|
+ fprintf (stddebug, "AHZ -> %d\n", ahz);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
#ifdef HAVE_ACUTIME
|
||||||
|
# ifdef ACUTIME_COMPT
|
||||||
|
double ut = comp_t_2_double (rec->ac_utime) / (double) ahz;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--- mktime.c.save 1997-10-14 01:40:36.000000000 +0100
|
--- mktime.c
|
||||||
+++ mktime.c 2006-08-31 09:18:15.000000000 +0100
|
+++ mktime.c
|
||||||
@@ -124,9 +124,7 @@
|
@@ -124,9 +124,7 @@
|
||||||
#define localtime_r my_localtime_r
|
#define localtime_r my_localtime_r
|
||||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 14 14:46:17 CET 2007 - mkudlvasr@suse.cz
|
||||||
|
|
||||||
|
- fixed ahz value problems [#244186]
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 5 15:32:51 CEST 2006 - anosek@suse.cz
|
Tue Sep 5 15:32:51 CEST 2006 - anosek@suse.cz
|
||||||
|
|
||||||
|
10
acct.spec
10
acct.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package acct (Version 6.3.5)
|
# spec file for package acct (Version 6.3.5)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
# package are under the same license as the package itself.
|
# package are under the same license as the package itself.
|
||||||
#
|
#
|
||||||
@ -11,12 +11,12 @@
|
|||||||
# norootforbuild
|
# norootforbuild
|
||||||
|
|
||||||
Name: acct
|
Name: acct
|
||||||
License: GPL
|
License: GNU General Public License (GPL)
|
||||||
Group: System/Base
|
Group: System/Base
|
||||||
PreReq: %insserv_prereq %fillup_prereq fileutils %install_info_prereq
|
PreReq: %insserv_prereq %fillup_prereq fileutils %install_info_prereq
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
Version: 6.3.5
|
Version: 6.3.5
|
||||||
Release: 696
|
Release: 718
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: rc.acct
|
Source1: rc.acct
|
||||||
Source2: logrotate.acct
|
Source2: logrotate.acct
|
||||||
@ -39,7 +39,7 @@ accounting: sa, accton, and lastcomm.
|
|||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Noel Cragg <noel@gnu.ai.mit.edu>
|
Noel Cragg <noel@gnu.org>
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
@ -113,6 +113,8 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/usr/sbin/*
|
/usr/sbin/*
|
||||||
|
|
||||||
%changelog -n acct
|
%changelog -n acct
|
||||||
|
* Wed Feb 14 2007 - mkudlvasr@suse.cz
|
||||||
|
- fixed ahz value problems [#244186]
|
||||||
* Tue Sep 05 2006 - anosek@suse.cz
|
* Tue Sep 05 2006 - anosek@suse.cz
|
||||||
- fixed compiler warning: old-style function definition
|
- fixed compiler warning: old-style function definition
|
||||||
[#203115] (warning.patch)
|
[#203115] (warning.patch)
|
||||||
|
Loading…
Reference in New Issue
Block a user