summaryrefslogtreecommitdiff
path: root/package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c
diff options
context:
space:
mode:
Diffstat (limited to 'package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c')
-rw-r--r--package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c b/package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c
new file mode 100644
index 000000000..f54a530dd
--- /dev/null
+++ b/package/util-linux-ng/patches/patch-fdisk_fdiskbsdlabel_c
@@ -0,0 +1,53 @@
+--- util-linux-ng-2.15.orig/fdisk/fdiskbsdlabel.c 2009-02-24 16:39:30.000000000 +0100
++++ util-linux-ng-2.15/fdisk/fdiskbsdlabel.c 2009-06-22 22:42:04.000000000 +0200
+@@ -538,10 +538,10 @@ xbsd_write_bootstrap (void)
+
+ /* We need a backup of the disklabel (xbsd_dlabel might have changed). */
+ d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
+- bcopy (d, &dl, sizeof (struct xbsd_disklabel));
++ memcpy (&dl, d, sizeof (struct xbsd_disklabel));
+
+ /* The disklabel will be overwritten by 0's from bootxx anyway */
+- bzero (d, sizeof (struct xbsd_disklabel));
++ memset (d, 0, sizeof (struct xbsd_disklabel));
+
+ snprintf (path, sizeof(path), "%s/boot%s", bootdir, dkbasename);
+ if (!xbsd_get_bootstrap (path, &disklabelbuffer[xbsd_dlabel.d_secsize],
+@@ -555,7 +555,7 @@ xbsd_write_bootstrap (void)
+ exit ( EXIT_FAILURE );
+ }
+
+- bcopy (&dl, d, sizeof (struct xbsd_disklabel));
++ memcpy (d, &dl, sizeof (struct xbsd_disklabel));
+
+ #if defined (__powerpc__) || defined (__hppa__)
+ sector = 0;
+@@ -657,7 +657,7 @@ xbsd_initlabel (struct partition *p, str
+ struct geom g;
+
+ get_geometry (fd, &g);
+- bzero (d, sizeof (struct xbsd_disklabel));
++ memset (d, 0, sizeof (struct xbsd_disklabel));
+
+ d -> d_magic = BSD_DISKMAGIC;
+
+@@ -740,8 +740,8 @@ xbsd_readlabel (struct partition *p, str
+ if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
+ fatal (unable_to_read);
+
+- bcopy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
+- d, sizeof (struct xbsd_disklabel));
++ memcpy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
++ sizeof (struct xbsd_disklabel));
+
+ if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC)
+ return 0;
+@@ -776,7 +776,7 @@ xbsd_writelabel (struct partition *p, st
+ /* This is necessary if we want to write the bootstrap later,
+ otherwise we'd write the old disklabel with the bootstrap.
+ */
+- bcopy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
++ memcpy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d,
+ sizeof (struct xbsd_disklabel));
+
+ #if defined (__alpha__) && BSD_LABELSECTOR == 0