summaryrefslogtreecommitdiff
path: root/libparted/labels/bsd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-08-13 22:36:27 +0200
committerJim Meyering <jim@meyering.net>2007-08-14 13:22:49 +0200
commiteb00dfeab241b9943138b33c9946da1e603d912a (patch)
tree822c266a03350b63241aa0af0b1185a0993141d5 /libparted/labels/bsd.c
parentc510c225cd815873e5489d3e0702d5b1d6124125 (diff)
downloadparted-eb00dfeab241b9943138b33c9946da1e603d912a.tar.gz
Fix mkpart linux-swap bug: would use 0x83 rather than 0x82
* libparted/labels/bsd.c (bsd_partition_set_system): Include "misc.h". Use is_linux_swap to test whether the type string matches. * libparted/labels/dasd.c (dasd_read, dasd_partition_set_system): Likewise. * libparted/labels/dos.c (msdos_partition_set_system): Likewise. * libparted/labels/mac.c (mac_partition_set_system): Likewise. * libparted/labels/rdb.c (amiga_partition_set_system): Likewise. * libparted/labels/sun.c (sun_partition_set_system): Likewise. Based on a patch by Kenneth MacDonald, from <http://lists.gnu.org/archive/html/bug-parted/2007-07/msg00012.html>. * libparted/labels/misc.h (is_linux_swap): New function/file. * libparted/labels/Makefile.am (liblabels_la_SOURCES): Add misc.h. * tests/t2100-mkswap.sh: New file, test for the above fix. * tests/Makefile.am (TESTS): Add t2100-mkswap.sh.
Diffstat (limited to 'libparted/labels/bsd.c')
-rw-r--r--libparted/labels/bsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
index f25353b..7aac5d9 100644
--- a/libparted/labels/bsd.c
+++ b/libparted/labels/bsd.c
@@ -32,6 +32,8 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
+#include "misc.h"
+
/* struct's & #define's stolen from libfdisk, which probably came from
* Linux...
*/
@@ -445,7 +447,7 @@ bsd_partition_set_system (PedPartition* part, const PedFileSystemType* fs_type)
if (!fs_type)
bsd_data->type = 0x8;
- else if (!strcmp (fs_type->name, "linux-swap"))
+ else if (is_linux_swap (fs_type->name))
bsd_data->type = 0x1;
else
bsd_data->type = 0x8;