rpms/procps/devel procps-3.2.5-top-rc.patch, NONE, 1.1 procps-3.2.5-top-sigwinch.patch, NONE, 1.1 procps-3.2.5-vmstat-parg.patch, NONE, 1.1 procps-3.2.5.remcpu.patch, NONE, 1.1 procps-3.2.5-sysctl-writeonly.patch, 1.1, 1.2 procps.spec, 1.37, 1.38

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Sep 6 13:56:03 UTC 2005


Author: kzak

Update of /cvs/dist/rpms/procps/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv30816

Modified Files:
	procps-3.2.5-sysctl-writeonly.patch procps.spec 
Added Files:
	procps-3.2.5-top-rc.patch procps-3.2.5-top-sigwinch.patch 
	procps-3.2.5-vmstat-parg.patch procps-3.2.5.remcpu.patch 
Log Message:
sync devel with FC4 and add remcpu patch

procps-3.2.5-top-rc.patch:
 top.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

--- NEW FILE procps-3.2.5-top-rc.patch ---
--- procps-3.2.5/top.c.rc	2005-06-28 22:36:24.000000000 +0200
+++ procps-3.2.5/top.c	2005-06-28 22:40:27.000000000 +0200
@@ -2393,7 +2393,10 @@
    int i;
 
    for (i = 0; i < GROUPSMAX; i++) {
-      win_names(&Winstk[i], Winstk[i].rc.winname);
+      /* Please, never use something like sprintf(x, "%s", x); ... see win_names() */
+      char buf[WINNAMSIZ];
+      strncpy(buf, Winstk[i].rc.winname, WINNAMSIZ);
+      win_names(&Winstk[i], buf);
       capsmk(&Winstk[i]);
    }
    // rely on this next guy to force a call (eventually) to reframewins

procps-3.2.5-top-sigwinch.patch:
 top.c |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

--- NEW FILE procps-3.2.5-top-sigwinch.patch ---
--- procps-3.2.5/top.c.sigwinch	2005-06-28 14:31:18.607714424 +0200
+++ procps-3.2.5/top.c	2005-06-28 14:53:21.179652928 +0200
@@ -140,6 +140,9 @@
            buffer is used, stdout is flushed at frame end or if interactive. */
 static char *Pseudo_scrn;
 static int   Pseudo_row, Pseudo_cols, Pseudo_size;
+
+static int Screen_resized;
+
 #ifndef STDOUT_IOLBF
         // less than stdout's normal buffer but with luck mostly '\n' anyway
 static char  Stdout_buf[2048];
@@ -2298,14 +2301,18 @@
 // Set the screen dimensions and arrange for the real workhorse.
 // (also) catches:
 //    SIGWINCH and SIGCONT
-static void wins_resize (int dont_care_sig)
+static void wins_resize_handler(int dont_care_sig)
+{
+	(void)dont_care_sig;
+	Screen_resized = 1;
+}
+
+static void wins_resize (void)
 {
    struct winsize wz;
    char *env_columns;  // Unix98 environment variable COLUMNS
    char *env_lines;    // Unix98 environment variable LINES
 
-   (void)dont_care_sig;
-
    Screen_cols = columns;   // <term.h>
    Screen_rows = lines;     // <term.h>
 
@@ -2349,6 +2356,9 @@
 
    // force rebuild of column headers AND libproc/readproc requirements
    Frames_libflags = 0;
+
+   Screen_resized = 0;
+   
    ZAP_TIMEOUT
 }
 
@@ -2397,7 +2407,7 @@
       capsmk(&Winstk[i]);
    }
    // rely on this next guy to force a call (eventually) to reframewins
-   wins_resize(0);
+   wins_resize();
 }
 
 
@@ -2429,7 +2439,7 @@
 
       case 'A':
          Rc.mode_altscr = !Rc.mode_altscr;
-         wins_resize(0);
+         wins_resize();
          break;
 
       case 'b':
@@ -3262,8 +3272,8 @@
    signal(SIGTSTP,  suspend);
    signal(SIGTTIN,  suspend);
    signal(SIGTTOU,  suspend);
-   signal(SIGCONT,  wins_resize);
-   signal(SIGWINCH, wins_resize);
+   signal(SIGCONT,  wins_resize_handler);
+   signal(SIGWINCH, wins_resize_handler);
 
    for (;;) {
       frame_make();
@@ -3277,6 +3287,8 @@
 
       if (Batch) {
          select(0, NULL, NULL, NULL, &tv);  // ought to loop until done
+	 if (Screen_resized)
+		 wins_resize();
       } else {
          long file_flags;
          int rc;
@@ -3298,6 +3310,9 @@
             select(1, &fs, NULL, NULL, &tv);
             fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK|file_flags);
          }
+	 if (Screen_resized)
+		 /* maybe select() wake up after signal */
+		 wins_resize();
          if (chin(0, &c, 1) > 0) {
             fcntl(STDIN_FILENO, F_SETFL, file_flags);
             do_key((unsigned)c);

procps-3.2.5-vmstat-parg.patch:
 vmstat.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE procps-3.2.5-vmstat-parg.patch ---
--- procps-3.2.5/vmstat.c.parg	2005-06-28 14:57:15.819982176 +0200
+++ procps-3.2.5/vmstat.c	2005-06-28 14:57:38.801488456 +0200
@@ -608,7 +608,7 @@
         statMode |= PARTITIONSTAT;
 	if (argv[1]){
 	           ++argv;
-		   sprintf(partition, "%s", *argv);
+		   snprintf(partition, sizeof(partition), "%s", *argv);
 	 }else{fprintf(stderr, "-p requires an argument\n");
                exit(EXIT_FAILURE);
 	}

procps-3.2.5.remcpu.patch:
 top.c |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 deletions(-)

--- NEW FILE procps-3.2.5.remcpu.patch ---
diff -ru procps-3.2.5/top.c procps-3.2.5-mod/top.c
--- procps-3.2.5/top.c	2005-01-26 00:15:18.000000000 -0500
+++ procps-3.2.5-mod/top.c	2005-06-16 17:10:14.000000000 -0400
@@ -907,6 +907,7 @@
 static CPU_t *cpus_refresh (CPU_t *cpus)
 {
    static FILE *fp = NULL;
+   static int cpu_max;
    int i;
    int num;
    // enough for a /proc/stat CPU line (not the intr line)
@@ -921,34 +922,35 @@
                can hold tics representing the /proc/stat cpu summary (the first
                line read) -- that slot supports our View_CPUSUM toggle */
       cpus = alloc_c((1 + Cpu_tot) * sizeof(CPU_t));
+      cpu_max = Cpu_tot;
    }
    rewind(fp);
    fflush(fp);
 
    // first value the last slot with the cpu summary line
    if (!fgets(buf, sizeof(buf), fp)) std_err("failed /proc/stat read");
-   cpus[Cpu_tot].x = 0;  // FIXME: can't tell by kernel version number
-   cpus[Cpu_tot].y = 0;  // FIXME: can't tell by kernel version number
+   cpus[cpu_max].x = 0;  // FIXME: can't tell by kernel version number
+   cpus[cpu_max].y = 0;  // FIXME: can't tell by kernel version number
    num = sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu",
-      &cpus[Cpu_tot].u,
-      &cpus[Cpu_tot].n,
-      &cpus[Cpu_tot].s,
-      &cpus[Cpu_tot].i,
-      &cpus[Cpu_tot].w,
-      &cpus[Cpu_tot].x,
-      &cpus[Cpu_tot].y
+      &cpus[cpu_max].u,
+      &cpus[cpu_max].n,
+      &cpus[cpu_max].s,
+      &cpus[cpu_max].i,
+      &cpus[cpu_max].w,
+      &cpus[cpu_max].x,
+      &cpus[cpu_max].y
    );
    if (num < 4)
          std_err("failed /proc/stat read");
 
    // and just in case we're 2.2.xx compiled without SMP support...
-   if (Cpu_tot == 1) {
+   if (cpu_max == 1) {
       cpus[1].id = 0;
-      memcpy(cpus, &cpus[1], sizeof(CPU_t));
+      memcpy(cpus, &cpus[cpu_max], sizeof(CPU_t));
    }
 
    // now value each separate cpu's tics
-   for (i = 0; 1 < Cpu_tot && i < Cpu_tot; i++) {
+   for (i = 0; ; i++) {
       if (!fgets(buf, sizeof(buf), fp)) std_err("failed /proc/stat read");
       cpus[i].x = 0;  // FIXME: can't tell by kernel version number
       cpus[i].y = 0;  // FIXME: can't tell by kernel version number
@@ -956,9 +958,22 @@
          &cpus[i].id,
          &cpus[i].u, &cpus[i].n, &cpus[i].s, &cpus[i].i, &cpus[i].w, &cpus[i].x, &cpus[i].y
       );
-      if (num < 4)
-            std_err("failed /proc/stat read");
+      if (num < 4) {
+	 Cpu_tot = i;
+	 break;
+      }
+      if (i == cpu_max - 1) {
+	 // Bump cpu_max and extend cpus
+	 cpu_max++;
+	 cpus = realloc(cpus, (1 + cpu_max) * sizeof(CPU_t));
+	 if (!cpus) std_err("realloc failed");
+	 memcpy(&cpus[cpu_max], &cpus[cpu_max-1], sizeof(CPU_t));
+      }
    }
+
+   if (cpu_max > Cpu_tot)
+      memcpy(&cpus[Cpu_tot], &cpus[cpu_max], sizeof(CPU_t));
+
    return cpus;
 }
 

procps-3.2.5-sysctl-writeonly.patch:
 sysctl.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

Index: procps-3.2.5-sysctl-writeonly.patch
===================================================================
RCS file: /cvs/dist/rpms/procps/devel/procps-3.2.5-sysctl-writeonly.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- procps-3.2.5-sysctl-writeonly.patch	26 Apr 2005 09:53:43 -0000	1.1
+++ procps-3.2.5-sysctl-writeonly.patch	6 Sep 2005 13:56:01 -0000	1.2
@@ -1,5 +1,5 @@
---- procps-3.2.5/sysctl.c.writeonly	2005-04-26 10:20:57.617343016 +0200
-+++ procps-3.2.5/sysctl.c	2005-04-26 10:34:26.545367264 +0200
+--- procps-3.2.5/sysctl.c.writeonly	2005-01-05 22:00:47.000000000 +0100
++++ procps-3.2.5/sysctl.c	2005-07-11 10:05:12.000000000 +0200
 @@ -127,7 +127,8 @@
     char *restrict tmpname;
     char *restrict outname;
@@ -25,3 +25,13 @@
  
     if (!fp) {
        switch(errno) {
+@@ -158,6 +165,9 @@
+          fprintf(stderr, ERR_PERMISSION_DENIED, outname);
+          rc = -1;
+          break;
++      case EINVAL:  /* fopen()/stat() invalid argument */
++      case ENOTTY:  /* inappropriate ioctl for device */
++	 break;
+       default:
+          fprintf(stderr, ERR_UNKNOWN_READING, strerror(errno), outname);
+          rc = -1;


Index: procps.spec
===================================================================
RCS file: /cvs/dist/rpms/procps/devel/procps.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- procps.spec	10 May 2005 12:05:17 -0000	1.37
+++ procps.spec	6 Sep 2005 13:56:01 -0000	1.38
@@ -1,7 +1,7 @@
 Summary: System and process monitoring utilities.
 Name: procps
 Version: 3.2.5
-Release: 6
+Release: 7
 License: GPL
 Group: Applications/System
 Source: http://procps.sourceforge.net/procps-%{version}.tar.gz
@@ -16,7 +16,16 @@
 Patch6: procps-3.2.3-noproc.patch
 Patch7: procps-3.2.3-pseudo.patch
 Patch8: procps-3.2.4-0x9b.patch
+# 157725 - sysctl -A returns an error
 Patch9: procps-3.2.5-sysctl-writeonly.patch
+# 161449 - "top" ignores user and system toprc
+Patch10: procps-3.2.5-top-rc.patch
+# 161559 - top segfaults when resizing konsole
+Patch11: procps-3.2.5-top-sigwinch.patch
+# 160796 - vmstat crashes when accessing LVM partition.
+Patch12: procps-3.2.5-vmstat-parg.patch
+# 161303 – 'top' failed when remove cpus
+Patch13: procps-3.2.5.remcpu.patch
 
 BuildRequires: ncurses-devel
 
@@ -53,6 +62,10 @@
 %patch7 -p1 -b .pseudo
 %patch8 -p1 -b .0x9b
 %patch9 -p1 -b .writeonly
+%patch10 -p1 -b .rc
+%patch11 -p1 -b .sigwinch
+%patch12 -p1 -b .parg
+%patch13 -p1 -b .remcpu
 
 cp %SOURCE1 .
 
@@ -90,6 +103,13 @@
 %attr(0644,root,root) %{_mandir}/man5/*
 
 %changelog
+* Tue Sep  6 2005 Karel Zak <kzak at redhat.com> 3.2.5-7
+- imporoved procps-3.2.5-sysctl-writeonly.patch
+- fix #161449 - "top" ignores user and system toprc
+- fix #161559 - top segfaults when resizing console
+- fix #160796 - vmstat crashes when accessing LVM partition
+- fix #161303 – 'top' failed when remove cpus
+
 * Tue May 10 2005 Karel Zak <kzak at redhat.com> 3.2.5-6
 - fix permissions in the spec install section
 
@@ -348,7 +368,7 @@
 * Mon Apr 15 2002 Bill Nottingham <notting at redhat.com> 2.0.7-12
 - add ldconfig in %postun
 
-* Mon Aug 27 2001 Trond Eivind Glomsrød <teg at redhat.com> 2.0.7-11
+* Mon Aug 27 2001 Trond Eivind Glomsrod <teg at redhat.com> 2.0.7-11
 - Add ncurses-devel as a build dependency (#49562)
 
 * Sat Jul 21 2001 Tim Powers <timp at redhat.com>




More information about the fedora-cvs-commits mailing list