Gentoo Archives: gentoo-commits

From: "Jeroen Roovers (jer)" <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/acct/files: acct-6.5.4-nan.patch
Date: Fri, 05 Nov 2010 16:21:24
Message-Id: 20101105162100.434B82003C@flycatcher.gentoo.org
1 jer 10/11/05 16:21:00
2
3 Added: acct-6.5.4-nan.patch
4 Log:
5 Fix division by zero by Robert Trace (bug #323105).
6
7 (Portage version: 2.1.9.24/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 sys-process/acct/files/acct-6.5.4-nan.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/acct/files/acct-6.5.4-nan.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/acct/files/acct-6.5.4-nan.patch?rev=1.1&content-type=text/plain
14
15 Index: acct-6.5.4-nan.patch
16 ===================================================================
17 From: Dominique Brazziel <dbrazziel@××××.net>
18 Subject: Fix for sa reporting 'inf' or 'nan' instead of correct values
19 because of division by clock values.
20 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581421
21 Last-Updated: 2010-07-23
22
23 --- acct-6.5.4.orig/sa.c 2010-02-11 20:55:14.000000000 -0500
24 +++ acct-6.5.4/sa.c 2010-07-22 14:08:26.000000000 -0400
25 @@ -417,7 +417,6 @@
26 (void)printf("%s: GNU Accounting Utilities (release %s)\n",
27 program_name, VERSION_STRING);
28 exit(EXIT_SUCCESS);
29 - case 4:
30 acct_file_name = optarg;
31 break;
32 case 'j':
33 @@ -594,8 +593,11 @@
34 exit(EXIT_FAILURE);
35 }
36
37 + /* Set HZ value from system */
38 + hzval = sysconf(_SC_CLK_TCK);
39 +
40 /* Print out some debugging information. */
41 -
42 +
43 if (debugging_enabled)
44 {
45 (void)fprintf (stddebug, "hzval -> %d\n", hzval);
46 @@ -1162,31 +1164,30 @@
47 # define CURR_AHZ ((double)(ahz))
48 #endif
49
50 -
51 if (debugging_enabled)
52 fprintf (stddebug, "\
53 ----------------------------------------------------------------------\n\
54 acct entries\n\
55 ----------------------------------------------------------------------\n\
56 ");
57 -
58 +
59 /* loop while there are entries to be had */
60 while ((rec = pacct_get_entry ()) != NULL)
61 {
62 #ifdef HAVE_ACUTIME
63 - double ut = comp_t_2_double (rec->ac_utime) / (double) hzval;
64 + double ut = comp_t_2_double (rec->ac_utime) / CURR_AHZ;
65 #endif
66
67 #ifdef HAVE_ACSTIME
68 - double st = comp_t_2_double (rec->ac_stime) / (double) hzval;
69 + double st = comp_t_2_double (rec->ac_stime) / CURR_AHZ;
70 #endif
71
72 #ifdef HAVE_ACETIME
73 - double et = comp_t_2_double (rec->ac_etime) / (double) hzval;
74 + double et = ACETIME_2_DOUBLE (rec->ac_etime) / CURR_AHZ;
75 #endif
76
77 #ifdef HAVE_ACIO
78 - double di = comp_t_2_double (rec->ac_io) / (double) hzval;
79 + double di = comp_t_2_double (rec->ac_io) / CURR_AHZ;
80 #endif
81
82 #ifdef HAVE_ACMEM