Re: [PATCH 04/13] fdisk: drop one parameter from try() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2011/12/22 Guillem Jover <guillem@xxxxxxxxxxx>:
> The logic on user_specified is inverted so it seems the checks on the
> call sites would need to be swapped?

Correct. Thank you for pointing out this.

Attached a patch to fix this regression.

Francesco
From 2cf578cd4abfbe0609e1de97de754cfcc19a558c Mon Sep 17 00:00:00 2001
From: Francesco Cosoleto <cosoleto@xxxxxxxxx>
Date: Thu, 22 Dec 2011 15:53:25 +0100
Subject: [PATCH] fdisk: fix incorrect position of is_ide_cdrom_or_tape() call

Reported-by: Guillem Jover <guillem@xxxxxxxxxxx>
Signed-off-by: Francesco Cosoleto <cosoleto@xxxxxxxxx>
---
 fdisk/fdisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index c41da7a..bde60a9 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -2848,7 +2848,8 @@ print_all_partition_table_from_option(void)
 		if (is_whole_disk(devname)) {
 			char *cn = canonicalize_path(devname);
 			if (cn) {
-				print_partition_table_from_option(cn);
+				if (!is_ide_cdrom_or_tape(cn))
+					print_partition_table_from_option(cn);
 				free(cn);
 			}
 		}
@@ -3057,8 +3058,7 @@ main(int argc, char **argv) {
 			dummy(&k);
 			listing = 1;
 			for (k = optind; k < argc; k++)
-				if (!is_ide_cdrom_or_tape(argv[k]))
-					print_partition_table_from_option(argv[k]);
+				print_partition_table_from_option(argv[k]);
 		} else
 			print_all_partition_table_from_option();
 		exit(0);
-- 
1.7.7


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux