rpms/psacct/devel psacct-6.5.1-LargeFile.patch, NONE, 1.1 psacct-6.5.1-exit.patch, NONE, 1.1 psacct-6.5.1-hzval-fixes2.patch, NONE, 1.1 psacct-6.5.1-pts.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 psacct.spec, 1.41, 1.42 sources, 1.2, 1.3 acct-6.3.2-exit.patch, 1.1, NONE acct-6.3.2-pts.patch, 1.1, NONE psacct-6.3.2-64bit-fixes.patch, 1.1, NONE psacct-6.3.2-LargeFile.patch, 1.1, NONE psacct-6.3.2-hzval-fixes2.patch, 1.1, NONE psacct-6.3.2-strictmatch.patch, 1.1, NONE

Ivana Varekova varekova at fedoraproject.org
Mon Dec 21 14:36:13 UTC 2009


Author: varekova

Update of /cvs/pkgs/rpms/psacct/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5750

Modified Files:
	.cvsignore psacct.spec sources 
Added Files:
	psacct-6.5.1-LargeFile.patch psacct-6.5.1-exit.patch 
	psacct-6.5.1-hzval-fixes2.patch psacct-6.5.1-pts.patch 
Removed Files:
	acct-6.3.2-exit.patch acct-6.3.2-pts.patch 
	psacct-6.3.2-64bit-fixes.patch psacct-6.3.2-LargeFile.patch 
	psacct-6.3.2-hzval-fixes2.patch psacct-6.3.2-strictmatch.patch 
Log Message:
- update to 6.5
  remove unnecessary patches, spec file changes


psacct-6.5.1-LargeFile.patch:
 configure |    6 +++---
 file_rd.c |   13 ++++++++-----
 file_rd.h |    8 +++++---
 3 files changed, 16 insertions(+), 11 deletions(-)

--- NEW FILE psacct-6.5.1-LargeFile.patch ---
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? */

psacct-6.5.1-exit.patch:
 accton.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE psacct-6.5.1-exit.patch ---
diff -up acct-6.5.1/accton.c.pom acct-6.5.1/accton.c
--- acct-6.5.1/accton.c.pom	2009-09-06 01:38:20.000000000 +0200
+++ acct-6.5.1/accton.c	2009-12-18 15:21:38.000000000 +0100
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
 
 
       /* did the system call return an error? */
-      if (-1 == status_acct)
+      if (-1 == status_acct  && errno != ENOSYS)
         {
           int err = errno;
           perror ("accton");

psacct-6.5.1-hzval-fixes2.patch:
 lastcomm.c |   10 ++++++++--
 sa.c       |   14 ++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)

--- NEW FILE psacct-6.5.1-hzval-fixes2.patch ---
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 at 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

psacct-6.5.1-pts.patch:
 dev_hash.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 69 insertions(+), 3 deletions(-)

--- NEW FILE psacct-6.5.1-pts.patch ---
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;
 }


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/psacct/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	9 Sep 2004 10:45:42 -0000	1.2
+++ .cvsignore	21 Dec 2009 14:36:12 -0000	1.3
@@ -1 +1 @@
-acct-6.3.2.tar.gz
+acct-6.5.1.tar.gz


Index: psacct.spec
===================================================================
RCS file: /cvs/pkgs/rpms/psacct/devel/psacct.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -p -r1.41 -r1.42
--- psacct.spec	9 Dec 2009 07:13:20 -0000	1.41
+++ psacct.spec	21 Dec 2009 14:36:13 -0000	1.42
@@ -11,23 +11,22 @@
 
 Summary: Utilities for monitoring process activities
 Name: psacct
-Version: 6.3.2
-Release: 57%{?dist}
+Version: 6.5.1
+Release: 1%{?dist}
 License: GPLv2+
 Group: Applications/System
-Source: ftp://ftp.gnu.org/pub/gnu/acct-6.3.2.tar.gz
+URL: ftp://ftp.gnu.org/pub/gnu/acct/
+Source: ftp://ftp.gnu.org/pub/gnu/acct/acct-%{version}.tar.gz
 Source1: psacct.init
 # This dumb patch breaks FHS 2.2 compliance, so it is disabled now except
 # in 7.x builds.  Do not use it in new products.
 Patch0: acct-6.3.2-config.patch
-Patch1: acct-6.3.2-exit.patch
+Patch1: psacct-6.5.1-exit.patch
 # Fixes some broken calls to ctime() on 64bit arch's <mharris at redhat.com>
-Patch2: psacct-6.3.2-64bit-fixes.patch
-Patch3: psacct-6.3.2-hzval-fixes2.patch
-Patch4: acct-6.3.2-pts.patch
-Patch5: psacct-6.3.2-strictmatch.patch
+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.3.2-LargeFile.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
@@ -56,11 +55,10 @@ commands.
 %if ! %{FHS_compliant}
 %patch0 -p0 -b .config
 %endif
+
 %patch1 -p1 -b .psacct-exit
-%patch2 -p0 -b .64bit-fixes
 %patch3 -p1 -b .hz
 %patch4 -p1 -b .pts
-%patch5 -p1 -b .strictmatch
 %patch6 -p1 -b .tio-avio
 %patch7 -p1 -b .lfs
 %patch8 -p1 -b .man
@@ -145,7 +143,7 @@ touch %{accounting_logdir}/pacct
 %preun
 if [ $1 = 0 ]; then
   /sbin/install-info --delete %{_infodir}/accounting.info.gz %{_infodir}/dir --entry="* accounting: (accounting).            The GNU Process Accounting Suite." 2>/dev/null
-  /sbin/service psacct stop > /dev/null 2>&1	
+  /sbin/service psacct stop > /dev/null 2>&1
   /sbin/chkconfig --del psacct
 fi
 
@@ -179,6 +177,10 @@ fi
 %{_infodir}/accounting.info.gz
 
 %changelog
+* Fri Dec 18 2009 Ivana Hutarova Varekova <varekova at redhat.com> - 6.5-1
+- update to 6.5
+  remove unnecessary patches, spec file changes
+
 * Fri Dec  9 2009 Ivana Hutarova Varekova <varekova at redhat.com> - 6.2.3-57
 - fix the initscript (service restart does not work)
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/psacct/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	9 Sep 2004 10:45:42 -0000	1.2
+++ sources	21 Dec 2009 14:36:13 -0000	1.3
@@ -1 +1 @@
-da0055b254f7da8b8920db83ef1ebba1  acct-6.3.2.tar.gz
+65c980063ad92de531ef47cf690829a6  acct-6.5.1.tar.gz


--- acct-6.3.2-exit.patch DELETED ---


--- acct-6.3.2-pts.patch DELETED ---


--- psacct-6.3.2-64bit-fixes.patch DELETED ---


--- psacct-6.3.2-LargeFile.patch DELETED ---


--- psacct-6.3.2-hzval-fixes2.patch DELETED ---


--- psacct-6.3.2-strictmatch.patch DELETED ---




More information about the fedora-extras-commits mailing list