bug-fdisk
[Top][All Lists]
Advanced

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

[bug-fdisk] linux-swap naming


From: Colin Watson
Subject: [bug-fdisk] linux-swap naming
Date: Tue, 6 Oct 2009 09:47:34 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

parted 1.9.0 uses a different filesystem type name for swap partitions.
For backward and forward compatibility, it's best to simply test whether
the type name starts with "linux-swap".

diff -r 9737316be4a6 src/fdisk.c
--- a/src/fdisk.c       Fri Jul 31 22:52:27 2009 +0200
+++ b/src/fdisk.c       Tue Oct 06 09:45:57 2009 +0100
@@ -1102,7 +1102,7 @@
                        ped_device_begin_external_access((*disk)->dev);
                        char *type = (char *)ped_partition_type_get_name 
(part->type);
                        if (part->fs_type
-                               && !strcmp (part->fs_type->name, "linux-swap"))
+                               && !strncmp (part->fs_type->name, "linux-swap", 
10))
                                printf ("%+4s %+21s ", _("82"), _("Linux Swap / 
Solaris"));
                        else if (is_bsd_partition ((*disk)->dev->path,
                                part->geom.start * sect_size, sect_size))

Thanks,

-- 
Colin Watson                                       address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]