Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 2d4ad1ca5d26eb2694d23ca68c3b8fe4 > files > 15

util-linux-ng-2.13-3.4mdv2008.0.src.rpm

--- util-linux-2.12r/fdisk/fdisk.c.rereadpt	2007-07-27 13:50:32.000000000 +0200
+++ util-linux-2.12r/fdisk/fdisk.c	2007-07-27 13:52:21.000000000 +0200
@@ -2163,6 +2163,10 @@ void
 reread_partition_table(int leave) {
 	int error = 0;
 	int i;
+	struct stat statbuf;
+
+	fstat(fd, &statbuf);
+	if(S_ISBLK(statbuf.st_mode)) { /* block device */
 
 	printf(_("Calling ioctl() to re-read partition table.\n"));
 	sync();
@@ -2187,6 +2191,7 @@ reread_partition_table(int leave) {
 			 "at the next reboot.\n"),
 			error, strerror(error));
 	}
+	} /* block device */
 
 	if (dos_changed)
 	    printf(