From b84edfcf527ded89a1522979b49a962788b9cfe031fbbd9a60cb2f1b2fc5b562 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 15 Feb 2007 17:09:44 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/acct?expand=0&rev=2 --- acct-6.3.5-hz.patch | 83 ++++++++++++++++++++++++---------------- acct-6.3.5-warning.patch | 6 +-- acct.changes | 5 +++ acct.spec | 10 +++-- 4 files changed, 64 insertions(+), 40 deletions(-) diff --git a/acct-6.3.5-hz.patch b/acct-6.3.5-hz.patch index cb77bb0..14212e8 100644 --- a/acct-6.3.5-hz.patch +++ b/acct-6.3.5-hz.patch @@ -1,14 +1,17 @@ --- lastcomm.c +++ lastcomm.c -@@ -47,6 +47,7 @@ - #endif +@@ -48,6 +48,10 @@ #include -+#include ++#ifdef HAVE_UNISTD_H ++#include ++#endif ++ #include "common.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 all items on the command line */ int print_controls = 0; /* don't print control characters */ @@ -17,25 +20,29 @@ 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 */ -+#ifndef HZ -+# define AHZ sysconf(_SC_CLK_TCK) -+#endif -+ void - main (int argc, char *argv[]) - { -@@ -98,6 +103,7 @@ - int other_pacct_file_specified = 0; /* nonzero if the user used the - `-f' or `--file' flag */ +@@ -288,6 +291,14 @@ + print_pacct_record (rec, stddebug); + } -+ ahz = AHZ; - program_name = argv[0]; - - /* Tell the pacct reader that we want to do things backwards! */ ++ 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)) + { + #ifdef HAVE_COMP_T --- sa.c +++ sa.c @@ -174,7 +174,7 @@ @@ -47,20 +54,30 @@ #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) -@@ -265,11 +265,16 @@ - +@@ -262,7 +262,6 @@ + int ask_if_junkable PARAMS((char *, int)); + + +- /* code */ -+#ifndef HZ -+# define AHZ sysconf(_SC_CLK_TCK) -+#endif -+ void - main (int argc, char *argv[]) - { - int c; - -+ ahz = AHZ; - program_name = argv[0]; - - /* Cache the page size of the machine for the PAGES_TO_KB macro */ +@@ -1116,6 +1115,18 @@ + /* loop while there are entries to be had */ + while ((rec = pacct_get_entry ()) != NULL) + { ++ 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 (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; diff --git a/acct-6.3.5-warning.patch b/acct-6.3.5-warning.patch index 8e50ccd..d3a2030 100644 --- a/acct-6.3.5-warning.patch +++ b/acct-6.3.5-warning.patch @@ -1,5 +1,5 @@ ---- mktime.c.save 1997-10-14 01:40:36.000000000 +0100 -+++ mktime.c 2006-08-31 09:18:15.000000000 +0100 +--- mktime.c ++++ mktime.c @@ -124,9 +124,7 @@ #define localtime_r my_localtime_r static struct tm *localtime_r __P ((const time_t *, struct tm *)); @@ -23,7 +23,7 @@ /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow. time_t overflow is OK, since @@ -173,8 +169,7 @@ - + /* Convert *TP to a time_t value. */ time_t -mktime (tp) diff --git a/acct.changes b/acct.changes index 466e67c..ce27ef4 100644 --- a/acct.changes +++ b/acct.changes @@ -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 diff --git a/acct.spec b/acct.spec index 87e0873..c94a53f 100644 --- a/acct.spec +++ b/acct.spec @@ -1,7 +1,7 @@ # # 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 # package are under the same license as the package itself. # @@ -11,12 +11,12 @@ # norootforbuild Name: acct -License: GPL +License: GNU General Public License (GPL) Group: System/Base PreReq: %insserv_prereq %fillup_prereq fileutils %install_info_prereq Autoreqprov: on Version: 6.3.5 -Release: 696 +Release: 718 Source: %{name}-%{version}.tar.bz2 Source1: rc.acct Source2: logrotate.acct @@ -39,7 +39,7 @@ accounting: sa, accton, and lastcomm. Authors: -------- - Noel Cragg + Noel Cragg %prep %setup -q @@ -113,6 +113,8 @@ rm -rf $RPM_BUILD_ROOT /usr/sbin/* %changelog -n acct +* Wed Feb 14 2007 - mkudlvasr@suse.cz +- fixed ahz value problems [#244186] * Tue Sep 05 2006 - anosek@suse.cz - fixed compiler warning: old-style function definition [#203115] (warning.patch)