rpms/procps/devel procps-3.2.5-sysctl-writeonly.patch, 1.2, 1.3 procps.spec, 1.41, 1.42

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Nov 8 10:58:42 UTC 2005


Author: kzak

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

Modified Files:
	procps-3.2.5-sysctl-writeonly.patch procps.spec 
Log Message:
fix sysctl

procps-3.2.5-sysctl-writeonly.patch:
 sysctl.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- procps-3.2.5-sysctl-writeonly.patch	6 Sep 2005 13:56:01 -0000	1.2
+++ procps-3.2.5-sysctl-writeonly.patch	8 Nov 2005 10:58:37 -0000	1.3
@@ -1,5 +1,5 @@
---- 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
+--- procps-3.2.6/sysctl.c.writeonly	2005-01-05 22:00:47.000000000 +0100
++++ procps-3.2.6/sysctl.c	2005-11-08 11:24:19.000000000 +0100
 @@ -127,7 +127,8 @@
     char *restrict tmpname;
     char *restrict outname;
@@ -25,7 +25,7 @@
  
     if (!fp) {
        switch(errno) {
-@@ -158,6 +165,9 @@
+@@ -158,12 +165,16 @@
           fprintf(stderr, ERR_PERMISSION_DENIED, outname);
           rc = -1;
           break;
@@ -35,3 +35,21 @@
        default:
           fprintf(stderr, ERR_UNKNOWN_READING, strerror(errno), outname);
           rc = -1;
+          break;
+       }
+    } else {
++      errno=0;
+       if(fgets(inbuf, sizeof inbuf - 1, fp)) {
+          // this loop is required, see
+          // /sbin/sysctl -a | egrep -6 dev.cdrom.info
+@@ -183,7 +194,9 @@
+                }
+             }
+          } while(fgets(inbuf, sizeof inbuf - 1, fp));
+-      } else {
++
++      /* fgets() returns NULL and errno without change if the file is empty */
++      } else if (errno) {
+          switch(errno) {
+          case EACCES:
+             fprintf(stderr, ERR_PERMISSION_DENIED, outname);


Index: procps.spec
===================================================================
RCS file: /cvs/dist/rpms/procps/devel/procps.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- procps.spec	1 Nov 2005 10:37:33 -0000	1.41
+++ procps.spec	8 Nov 2005 10:58:37 -0000	1.42
@@ -1,7 +1,7 @@
 Summary: System and process monitoring utilities.
 Name: procps
 Version: 3.2.6
-Release: 1
+Release: 2
 License: GPL
 Group: Applications/System
 Source: http://procps.sourceforge.net/procps-%{version}.tar.gz
@@ -97,6 +97,9 @@
 %attr(0644,root,root) %{_mandir}/man5/*
 
 %changelog
+* Tue Nov  8 2005 Karel Zak <kzak at redhat.com> 3.2.6-2
+- fix #157725 - sysctl -A returns an error
+
 * Mon Oct 31 2005 Karel Zak <kzak at redhat.com> 3.2.6-1
 - update to new upstream release
 




More information about the fedora-cvs-commits mailing list