1
0

patch-fdisk_fdiskbsdlabel_c 2.1 KB

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