rpms/parted/devel parted-1.6.25-dm.patch,1.5,1.6

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Feb 23 02:01:55 UTC 2006


Author: pjones

Update of /cvs/dist/rpms/parted/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv20078

Modified Files:
	parted-1.6.25-dm.patch 
Log Message:
- close /proc/devices correctly


parted-1.6.25-dm.patch:
 configure.in            |   12 +
 include/parted/device.h |    3 
 libparted/Makefile.am   |    1 
 libparted/linux.c       |  344 +++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 357 insertions(+), 3 deletions(-)

Index: parted-1.6.25-dm.patch
===================================================================
RCS file: /cvs/dist/rpms/parted/devel/parted-1.6.25-dm.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- parted-1.6.25-dm.patch	8 Feb 2006 20:19:05 -0000	1.5
+++ parted-1.6.25-dm.patch	23 Feb 2006 02:01:09 -0000	1.6
@@ -56,7 +56,7 @@
  
  #include "blkpg.h"
  
-@@ -270,6 +272,96 @@
+@@ -270,6 +272,99 @@
  }
  
  static int
@@ -109,8 +109,10 @@
 +	if (fd < 0)
 +		return 0;
 +
-+	if (readFD(fd, &buf) < 0)
-+		return 0; 
++	if (readFD(fd, &buf) < 0) {
++		close(fd);
++		return 0;
++	}
 +	line = buf;
 +	end = strchr(line, '\n');
 +	while (end && *end) {
@@ -121,7 +123,6 @@
 +		*end = '\0';
 +
 +		if (!bd) {
-+
 +			if (!strncmp(line, "Block devices:", 14))
 +				bd = 1;
 +			goto next;
@@ -134,6 +135,7 @@
 +		maj = strtol(line, &name, 10);
 +		if (maj == major) {
 +			free(buf);
++			close(fd);
 +			return 1;
 +		}
 +
@@ -146,6 +148,7 @@
 +			end = line;
 +	}
 +	free(buf);
++	close(fd);
 +	return 0;
 +}
 +
@@ -153,7 +156,7 @@
  _device_stat (PedDevice* dev, struct stat * dev_stat)
  {
  	PED_ASSERT (dev != NULL, return 0);
-@@ -330,6 +422,8 @@
+@@ -330,6 +425,8 @@
  		dev->type = PED_DEVICE_CPQARRAY;
  	} else if (dev_major == UBD_MAJOR && (dev_minor % 0x10 == 0)) {
  		dev->type = PED_DEVICE_UBD;
@@ -162,7 +165,7 @@
  	} else {
  		dev->type = PED_DEVICE_UNKNOWN;
  	}
-@@ -973,6 +1067,11 @@
+@@ -973,6 +1070,11 @@
  			goto error_free_arch_specific;
  		break;
  
@@ -174,7 +177,7 @@
  	case PED_DEVICE_UNKNOWN:
  		if (!init_generic (dev, _("Unknown")))
  			goto error_free_arch_specific;
-@@ -1624,6 +1723,7 @@
+@@ -1624,6 +1726,7 @@
  	} else if (dev->type == PED_DEVICE_DAC960
  			|| dev->type == PED_DEVICE_CPQARRAY
  			|| dev->type == PED_DEVICE_ATARAID
@@ -182,7 +185,7 @@
  			|| isdigit (dev->path[path_len - 1]))
  	        snprintf (result, result_len, "%sp%d", dev->path, num);
  	else
-@@ -1836,6 +1936,243 @@
+@@ -1836,6 +1939,243 @@
  }
  
  static int
@@ -426,7 +429,7 @@
  _kernel_reread_part_table (PedDevice* dev)
  {
  	LinuxSpecific*	arch_specific = LINUX_SPECIFIC (dev);
-@@ -1878,7 +2215,9 @@
+@@ -1878,7 +2218,9 @@
  static int
  linux_disk_commit (PedDisk* disk)
  {




More information about the fedora-cvs-commits mailing list