summaryrefslogtreecommitdiff
path: root/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
Initial import
Diffstat (limited to 'package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c')
-rw-r--r--package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c b/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
new file mode 100644
index 000000000..7c57b9e40
--- /dev/null
+++ b/package/util-linux/patches/patch-fdisk_fdiskbsdlabel_c
@@ -0,0 +1,54 @@
+$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
+--- util-linux-2.12r.orig/fdisk/fdiskbsdlabel.c 2003-07-13 23:12:47.000000000 +0200
++++ util-linux-2.12r/fdisk/fdiskbsdlabel.c 2008-10-16 12:28:32.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