summaryrefslogtreecommitdiff
path: root/source/ap/acct
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2013-11-04 17:08:47 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 22:57:36 +0200
commit76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (patch)
tree9b98e6e193c7870cb27ac861394c1c4592850922 /source/ap/acct
parent9664bee729d487bcc0a0bc35859f8e13d5421c75 (diff)
downloadcurrent-76fc4757ac91ac7947a01fb7b53dddf9a78a01d1.tar.gz
Slackware 14.1slackware-14.1
Mon Nov 4 17:08:47 UTC 2013 Slackware 14.1 x86_64 stable is released! It's been another interesting release cycle here at Slackware bringing new features like support for UEFI machines, updated compilers and development tools, the switch from MySQL to MariaDB, and many more improvements throughout the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/ap/acct')
-rw-r--r--source/ap/acct/581421-sa-hz-division.patch66
-rwxr-xr-xsource/ap/acct/acct.SlackBuild6
2 files changed, 70 insertions, 2 deletions
diff --git a/source/ap/acct/581421-sa-hz-division.patch b/source/ap/acct/581421-sa-hz-division.patch
new file mode 100644
index 00000000..0c15c017
--- /dev/null
+++ b/source/ap/acct/581421-sa-hz-division.patch
@@ -0,0 +1,66 @@
+From: Dominique Brazziel <dbrazziel@snet.net>
+Subject: Fix for sa reporting 'inf' or 'nan' instead of correct values
+ because of division by clock values.
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581421
+Last-Updated: 2010-07-23
+
+--- acct-6.5.4.orig/sa.c 2010-02-11 20:55:14.000000000 -0500
++++ acct-6.5.4/sa.c 2010-07-22 14:08:26.000000000 -0400
+@@ -417,7 +417,6 @@
+ (void)printf("%s: GNU Accounting Utilities (release %s)\n",
+ program_name, VERSION_STRING);
+ exit(EXIT_SUCCESS);
+- case 4:
+ acct_file_name = optarg;
+ break;
+ case 'j':
+@@ -594,8 +593,11 @@
+ exit(EXIT_FAILURE);
+ }
+
++ /* Set HZ value from system */
++ hzval = sysconf(_SC_CLK_TCK);
++
+ /* Print out some debugging information. */
+-
++
+ if (debugging_enabled)
+ {
+ (void)fprintf (stddebug, "hzval -> %d\n", hzval);
+@@ -1162,31 +1164,30 @@
+ # define CURR_AHZ ((double)(ahz))
+ #endif
+
+-
+ if (debugging_enabled)
+ fprintf (stddebug, "\
+ ----------------------------------------------------------------------\n\
+ acct entries\n\
+ ----------------------------------------------------------------------\n\
+ ");
+-
++
+ /* loop while there are entries to be had */
+ while ((rec = pacct_get_entry ()) != NULL)
+ {
+ #ifdef HAVE_ACUTIME
+- double ut = comp_t_2_double (rec->ac_utime) / (double) hzval;
++ double ut = comp_t_2_double (rec->ac_utime) / CURR_AHZ;
+ #endif
+
+ #ifdef HAVE_ACSTIME
+- double st = comp_t_2_double (rec->ac_stime) / (double) hzval;
++ double st = comp_t_2_double (rec->ac_stime) / CURR_AHZ;
+ #endif
+
+ #ifdef HAVE_ACETIME
+- double et = comp_t_2_double (rec->ac_etime) / (double) hzval;
++ double et = ACETIME_2_DOUBLE (rec->ac_etime) / CURR_AHZ;
+ #endif
+
+ #ifdef HAVE_ACIO
+- double di = comp_t_2_double (rec->ac_io) / (double) hzval;
++ double di = comp_t_2_double (rec->ac_io) / CURR_AHZ;
+ #endif
+
+ #ifdef HAVE_ACMEM
diff --git a/source/ap/acct/acct.SlackBuild b/source/ap/acct/acct.SlackBuild
index bfdd46fd..43cc9745 100755
--- a/source/ap/acct/acct.SlackBuild
+++ b/source/ap/acct/acct.SlackBuild
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright 2006, 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2006, 2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
PKGNAM=acct
PKGVER=6.5.4
VERSION=6.5.4
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -66,6 +66,8 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+zcat $CWD/581421-sa-hz-division.patch.gz | patch -p1 || exit 1
+
zcat $CWD/acct.logdir.fhs.diff.gz | patch -p1 || exit 1
# Need this after patching configure.ac:
autoreconf