patch-fdisk_fdiskbsdlabel_c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- util-linux-2.12r.orig/fdisk/fdiskbsdlabel.c 2003-07-13 23:12:47.000000000 +0200
  3. +++ util-linux-2.12r/fdisk/fdiskbsdlabel.c 2008-10-16 12:28:32.000000000 +0200
  4. @@ -538,10 +538,10 @@ xbsd_write_bootstrap (void)
  5. /* We need a backup of the disklabel (xbsd_dlabel might have changed). */
  6. d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
  7. - bcopy (d, &dl, sizeof (struct xbsd_disklabel));
  8. + memcpy (&dl, d, sizeof (struct xbsd_disklabel));
  9. /* The disklabel will be overwritten by 0's from bootxx anyway */
  10. - bzero (d, sizeof (struct xbsd_disklabel));
  11. + memset (d, 0 ,sizeof (struct xbsd_disklabel));
  12. snprintf (path, sizeof(path), "%s/boot%s", bootdir, dkbasename);
  13. if (!xbsd_get_bootstrap (path, &disklabelbuffer[xbsd_dlabel.d_secsize],
  14. @@ -555,7 +555,7 @@ xbsd_write_bootstrap (void)
  15. exit ( EXIT_FAILURE );
  16. }
  17. - bcopy (&dl, d, sizeof (struct xbsd_disklabel));
  18. + memcpy (d, &dl, sizeof (struct xbsd_disklabel));
  19. #if defined (__powerpc__) || defined (__hppa__)
  20. sector = 0;
  21. @@ -657,7 +657,7 @@ xbsd_initlabel (struct partition *p, str
  22. struct geom g;
  23. get_geometry (fd, &g);
  24. - bzero (d, sizeof (struct xbsd_disklabel));
  25. + memset (d, 0, sizeof (struct xbsd_disklabel));
  26. d -> d_magic = BSD_DISKMAGIC;
  27. @@ -740,8 +740,8 @@ xbsd_readlabel (struct partition *p, str
  28. if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
  29. fatal (unable_to_read);
  30. - bcopy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
  31. - d, sizeof (struct xbsd_disklabel));
  32. + memcpy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
  33. + sizeof (struct xbsd_disklabel));
  34. if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC)
  35. return 0;
  36. @@ -776,7 +776,7 @@ xbsd_writelabel (struct partition *p, st
  37. /* This is necessary if we want to write the bootstrap later,
  38. otherwise we'd write the old disklabel with the bootstrap.
  39. */
  40. - bcopy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
  41. + memcpy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d,
  42. sizeof (struct xbsd_disklabel));
  43. #if defined (__alpha__) && BSD_LABELSECTOR == 0