- update to 6.5.4

- remove obsolete patches
- fix license tag
This commit is contained in:
Ivana Varekova 2010-02-12 13:05:15 +00:00
parent 71203a44c7
commit aaffc9963c
8 changed files with 15 additions and 376 deletions

View File

@ -1 +1 @@
acct-6.5.1.tar.gz
acct-6.5.4.tar.gz

View File

@ -1,11 +1,12 @@
--- acct-6.3.2/lastcomm.1.pom 1997-09-30 01:41:53.000000000 +0200
+++ acct-6.3.2/lastcomm.1 2007-01-02 09:45:19.000000000 +0100
@@ -99,7 +99,7 @@
diff -up acct-6.5.4/lastcomm.1.pom acct-6.5.4/lastcomm.1
--- acct-6.5.4/lastcomm.1.pom 2010-01-23 20:18:03.000000000 +0100
+++ acct-6.5.4/lastcomm.1 2010-02-12 12:57:34.000000000 +0100
@@ -111,7 +111,7 @@ For each entry the following information
D -- command terminated with the generation of a core file
X -- command was terminated with the signal SIGTERM
+ the name of the user who ran the process
- + time the process exited
+ + time the process started
.SH OPTIONS
\. .PD 0
.PD 0
.TP

View File

@ -1,89 +0,0 @@
diff -up acct-6.5.1/configure.pom acct-6.5.1/configure
--- acct-6.5.1/configure.pom 2009-09-06 20:06:58.000000000 +0200
+++ acct-6.5.1/configure 2009-12-21 15:24:37.000000000 +0100
@@ -3684,12 +3684,12 @@ fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
+ CFLAGS="$ac_save_CFLAGS -D_FILE_OFFSET_BITS=64"
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
- CFLAGS="-g -O2"
+ CFLAGS="-g -O2 -D_FILE_OFFSET_BITS=64"
else
- CFLAGS="-g"
+ CFLAGS="-g -D_FILE_OFFSET_BITS=64"
fi
else
if test "$GCC" = yes; then
diff -up acct-6.5.1/file_rd.c.pom acct-6.5.1/file_rd.c
--- acct-6.5.1/file_rd.c.pom 2009-09-06 01:39:50.000000000 +0200
+++ acct-6.5.1/file_rd.c 2009-12-21 15:26:30.000000000 +0100
@@ -7,6 +7,9 @@
#include "config.h"
+#define _LARGEFILE_SOURCE 1
+#define _FILE_OFFSET_BITS 64
+
#include <stdio.h>
#ifdef HAVE_STRING_H
@@ -103,9 +106,9 @@ char *file_reader_get_entry(struct file_
if (fri->backwards)
{
- long offset, max_recs, recs_to_read;
+ off_t offset, max_recs, recs_to_read;
- if ((offset = ftell (fri->fp)) <= 0)
+ if ((offset = ftello (fri->fp)) <= 0)
goto no_more_records;
/* Read as many records as possible, up to
@@ -124,8 +127,8 @@ char *file_reader_get_entry(struct file_
if (debugging_enabled)
{
- long new_offset = ftell (fri->fp);
- fprintf (stddebug, "Did seek in file %ld --> %ld\n",
+ off_t new_offset = ftello (fri->fp);
+ fprintf (stddebug, "Did seek in file %lld --> %lld\n",
offset, new_offset);
}
@@ -134,7 +137,7 @@ char *file_reader_get_entry(struct file_
fatal ("get_entry: couldn't read from file");
if (debugging_enabled)
- fprintf (stddebug, "Got %ld records from file\n",
+ fprintf (stddebug, "Got %lld records from file\n",
recs_to_read);
/* don't need to check this, because the above read was fine */
diff -up acct-6.5.1/file_rd.h.pom acct-6.5.1/file_rd.h
--- acct-6.5.1/file_rd.h.pom 2009-09-05 03:15:49.000000000 +0200
+++ acct-6.5.1/file_rd.h 2009-12-21 15:27:24.000000000 +0100
@@ -4,6 +4,8 @@
* record-oriented files.
*
*/
+#define __USE_XOPEN
+#include <unistd.h>
struct file_list
{
@@ -19,9 +21,9 @@ struct file_rd_info
because we close files as soon as
we find their ends and free their
entries from the linked list */
- int recs_read; /* how many records are in our buffer? */
- int recs_left; /* how many records are left in the
- buffer to be used? */
+ off_t recs_read; /* how many records are in our buffer? */
+ off_t recs_left; /* how many records are left in the
+ buffer to be used? */
void *buffer; /* the buffer for the data */
int buffered_records; /* how many records to buffer */
int record_size; /* how big is each record? */

View File

@ -1,34 +0,0 @@
diff -up acct-6.5.1/configure.pom acct-6.5.1/configure
--- acct-6.5.1/configure.pom 2010-01-04 14:24:09.000000000 +0100
+++ acct-6.5.1/configure 2010-01-04 14:23:33.000000000 +0100
@@ -21351,10 +21351,10 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifndef ACCT_FILE
# if defined(__FreeBSD__) || defined(__linux__)
-# define ACCT_FILE "/var/log/account/pacct"
+# define ACCT_FILE "/var/account/pacct"
# else
# if defined(__NetBSD__)
-# define ACCT_FILE "/var/log/account/acct"
+# define ACCT_FILE "/var/account/acct"
# else
# if defined(sun) || defined(AMIX)
# define ACCT_FILE "/var/adm/pacct"
@@ -21371,7 +21371,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifndef SAVACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
-# define SAVACCT_FILE "/var/log/account/savacct"
+# define SAVACCT_FILE "/var/account/savacct"
# else
# if defined(sun) || defined(AMIX)
# define SAVACCT_FILE "/var/adm/savacct"
@@ -21387,7 +21387,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#ifndef USRACCT_FILE
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__linux__)
-# define USRACCT_FILE "/var/log/account/usracct"
+# define USRACCT_FILE "/var/account/usracct"
# else
# if defined(sun) || defined(AMIX)
# define USRACCT_FILE "/var/adm/usracct"

View File

@ -1,109 +0,0 @@
diff -up acct-6.5.1/lastcomm.c.hz acct-6.5.1/lastcomm.c
--- acct-6.5.1/lastcomm.c.hz 2009-09-06 01:39:50.000000000 +0200
+++ acct-6.5.1/lastcomm.c 2009-12-18 15:24:13.000000000 +0100
@@ -43,6 +43,9 @@ MA 02139, USA. */
# include <time.h>
# endif
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include <pwd.h>
@@ -73,6 +76,7 @@ char *program_name; /* name of the prog
int show_paging = 0; /* If they want paging stats, print 'em */
+static unsigned int hzval;
/* Here are various lists for the user to specify entries that they
want to see. */
@@ -100,6 +104,8 @@ int main(int argc, char *argv[])
`-f' or `--file' flag */
int backwards = 1; /* default to reading backwards */
+ hzval = sysconf(_SC_CLK_TCK);
+
program_name = argv[0];
while (1)
@@ -396,7 +402,7 @@ void parse_entries(void)
#ifdef LINUX_MULTIFORMAT
((ut + st) / (double) rec->ac_ahz),
#else
- ((ut + st) / (double) ahz),
+ ((ut + st) / (double) hzval),
#endif
ctime (&btime));
else
@@ -406,7 +412,7 @@ void parse_entries(void)
#ifdef LINUX_MULTIFORMAT
((ut + st) / (double) rec->ac_ahz),
#else
- ((ut + st) / (double) ahz),
+ ((ut + st) / (double) hzval),
#endif
ctime (&btime));
#else
diff -up acct-6.5.1/sa.c.hz acct-6.5.1/sa.c
--- acct-6.5.1/sa.c.hz 2009-09-06 17:54:56.000000000 +0200
+++ acct-6.5.1/sa.c 2009-12-18 15:25:54.000000000 +0100
@@ -253,6 +253,7 @@ int print_all_records = 0; /* don't lump
"***other" category */
int always_yes = 0; /* nonzero means always answer yes to
a query */
+static unsigned int hzval;
/* prototypes */
@@ -281,6 +282,7 @@ int main(int argc, char *argv[])
{
int c;
+ static unsigned int hzval;
program_name = argv[0];
/* Cache the page size of the machine for the PAGES_TO_KB macro */
@@ -598,7 +600,7 @@ int main(int argc, char *argv[])
if (debugging_enabled)
{
- (void)fprintf (stddebug, "AHZ -> %d\n", ahz);
+ (void)fprintf (stddebug, "hzval -> %d\n", hzval);
(void)fprintf (stddebug, "getpagesize() -> %d\n", getpagesize ());
(void)fprintf (stddebug, "system_page_size == %.2f\n", system_page_size);
}
@@ -962,7 +964,7 @@ static void print_stats_nicely (struct s
/* Christoph Badura <bad@flatlin.ka.sub.org> says:
*
* The k*sec statistic is computed as
- * ((ac_utime+ac_stime)*pages_to_kbytes(ac_mem))/AHZ. Of course you
+ * ((ac_utime+ac_stime)*pages_to_kbytes(ac_mem))/hzval. Of course you
* need to expand the comp_t values.
*
* PAGES_TO_KBYTES(x) simply divides x by (getpagesize()/1024). Of
@@ -1176,19 +1178,19 @@ void parse_acct_entries (void)
while ((rec = pacct_get_entry ()) != NULL)
{
#ifdef HAVE_ACUTIME
- double ut = comp_t_2_double (rec->ac_utime) / CURR_AHZ;
+ double ut = comp_t_2_double (rec->ac_utime) / (double) hzval;
#endif
#ifdef HAVE_ACSTIME
- double st = comp_t_2_double (rec->ac_stime) / CURR_AHZ;
+ double st = comp_t_2_double (rec->ac_stime) / (double) hzval;
#endif
#ifdef HAVE_ACETIME
- double et = ACETIME_2_DOUBLE (rec->ac_etime) / CURR_AHZ;
+ double et = comp_t_2_double (rec->ac_etime) / (double) hzval;
#endif
#ifdef HAVE_ACIO
- double di = comp_t_2_double (rec->ac_io) / CURR_AHZ;
+ double di = comp_t_2_double (rec->ac_io) / (double) hzval;
#endif
#ifdef HAVE_ACMEM

View File

@ -1,126 +0,0 @@
diff -up acct-6.5.1/dev_hash.c.orig acct-6.5.1/dev_hash.c
--- acct-6.5.1/dev_hash.c.orig 2009-09-06 01:39:50.000000000 +0200
+++ acct-6.5.1/dev_hash.c 2009-12-21 14:01:24.000000000 +0100
@@ -31,6 +31,7 @@ char *alloca ();
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
#include <pwd.h>
#include "common.h"
@@ -54,6 +55,11 @@ char *alloca ();
# endif
#endif
+#ifdef __linux__
+#define NULLDEV 0
+#else
+#define NULLDEV -1
+#endif
/* globals */
@@ -64,6 +70,54 @@ struct dev_data
char *name; /* name of the device */
};
+/* hash all possible /dev/pts devices as they only appear
+ * in the filesystem when the device is active.
+ */
+
+static void
+setup_pts_devices () {
+
+ struct utsname uts;
+ struct dev_data dd;
+ int i;
+ struct pts_params {
+ char *utsname; /* os name */
+ int base; /* base major number */
+ int max; /* max # of devices */
+ int mod; /* number of minors per major */
+ } *pts_ent, pts_table[] = {
+ {"Linux", 136, 2048, 256},
+ { }
+ };
+
+ if( uname (&uts) ) {
+ /* silent error */
+ return;
+ }
+
+ for (pts_ent = &(pts_table[0]); pts_ent != NULL; ++pts_ent) {
+ if (!strcmp (uts.sysname, pts_ent->utsname))
+ break;
+ }
+ if (pts_ent == NULL) return; /* unsupported OS */
+
+ for (i = 0; i < pts_ent->max; ++i) {
+ long dev_num;
+ struct hashtab_elem *he;
+ int major, minor;
+
+ major = pts_ent->base + (i/pts_ent->mod);
+ minor = i % pts_ent->mod;
+ dev_num = ((major << 8) + minor);
+
+ dd.name = xmalloc (sizeof(char) * (strlen("pts/xxxx") + 1));
+ sprintf (dd.name, "pts/%d", i);
+
+ he = hashtab_create (dev_table, (void *) & dev_num, sizeof(dev_num));
+ hashtab_set_value (he, &dd, sizeof (dd));
+ }
+}
+
/* Read the DIRNAME directory entries and make a linked list of ttys
(so we can search through it later) */
@@ -80,6 +134,13 @@ static void setup_devices(char *dirname)
if ((dirp = opendir (dirname)) == NULL)
return; /* skip it silently */
+ if (!strcmp (dirname, "/dev/pts")) {
+ /* assuming SysV, these are dynamically allocated */
+ closedir (dirp);
+ setup_pts_devices ();
+ return;
+ }
+
for (dp = readdir (dirp); dp != NULL; dp = readdir (dirp))
{
char *fullname = (char *) alloca ((strlen (dirname)
@@ -122,10 +183,11 @@ static void setup_devices(char *dirname)
char *dev_gnu_name(long dev_num)
{
struct hashtab_elem *he;
+ static char devstr [20];
/* special case */
- if (dev_num == -1)
+ if (dev_num == NULLDEV)
return "__";
if (dev_table == NULL)
@@ -134,6 +196,7 @@ char *dev_gnu_name(long dev_num)
setup_devices ("/dev"); /* most certainly */
setup_devices ("/dev/pty"); /* perhaps */
setup_devices ("/dev/ptym"); /* perhaps */
+ setup_devices ("/dev/pts"); /* perhaps */
}
he = hashtab_find (dev_table, (void *) &dev_num, sizeof (dev_num));
@@ -144,7 +207,10 @@ char *dev_gnu_name(long dev_num)
return dd->name;
}
- /* didn't find it */
+ /* didn't find it, return it as [maj,min] */
+
+ sprintf (devstr, "[%d,%d]", /* is this portable? */
+ (int) ((dev_num & 0xFF00) >> 8), (int) (dev_num & 0x00FF));
- return "??";
+ return devstr;
}

View File

@ -11,9 +11,9 @@
Summary: Utilities for monitoring process activities
Name: psacct
Version: 6.5.1
Release: 5%{?dist}
License: GPLv2+
Version: 6.5.4
Release: 1%{?dist}
License: GPLv3+
Group: Applications/System
URL: ftp://ftp.gnu.org/pub/gnu/acct/
Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%{version}.tar.gz
@ -23,15 +23,10 @@ Source2: psacct-logrotate.in
# in 7.x builds. Do not use it in new products.
Patch0: acct-6.3.2-config.patch
Patch1: psacct-6.5.1-exit.patch
# Fixes some broken calls to ctime() on 64bit arch's <mharris@redhat.com>
Patch3: psacct-6.5.1-hzval-fixes2.patch
Patch4: psacct-6.5.1-pts.patch
Patch6: psacct-6.3.2-sa-manfix.patch
Patch7: psacct-6.5.1-LargeFile.patch
Patch8: psacct-6.3.2-lastcomm_man.patch
Patch9: acct-6.3.2-sa_manpage.patch
Patch11: psacct-6.3.2-man-pages.patch
Patch12: psacct-6.5.1-acct_log.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: /sbin/chkconfig /sbin/install-info
@ -59,14 +54,10 @@ commands.
%endif
%patch1 -p1 -b .psacct-exit
%patch3 -p1 -b .hz
%patch4 -p1 -b .pts
%patch6 -p1 -b .tio-avio
%patch7 -p1 -b .lfs
%patch8 -p1 -b .man
%patch9 -p1 -b .pct
%patch11 -p1 -b .new
%patch12 -p1 -b .log
%build
%if ! %{FHS_compliant}
@ -162,6 +153,11 @@ fi
%{_infodir}/accounting.info.gz
%changelog
* Fri Feb 12 2010 Ivana Hutarova Varekova <varekova@redhat.com> - 6.5.4-1
- update to 6.5.4
- remove obsolete patches
- fix license tag
* Wed Jan 28 2010 Ivana Hutarova Varekova <varekova@redhat.com> - 6.5.1-5
- Fix the logrotate script and split its template to a separate file.
(Michal Schmidt patch, thanks)

View File

@ -1 +1 @@
65c980063ad92de531ef47cf690829a6 acct-6.5.1.tar.gz
a0e6cd4bd3ad744a434828f0b6de92df acct-6.5.4.tar.gz