source:
patches/util-linux-2.12r-gcc41_sun_disklabel_fixes-1.patch@
a33dbaa
Last change on this file since a33dbaa was 5c5752c, checked in by , 19 years ago | |
---|---|
|
|
File size: 1.0 KB |
-
fdisk/fdisksunlabel.c
Submitted By: Joe Ciccone <joeciccone at crazyeyesoft dot com> Date: 2006-04-14 Initial Package Version: 2.12r Upstream Status: Sent Origin: Joe Ciccone Description: This patch fixes fdisk so that it can properly calculate the checksum of a sun disklabel.
old new 118 118 int 119 119 check_sun_label(void) { 120 120 unsigned short *ush; 121 int csum ;121 int csum = 0; 122 122 123 123 if (sunlabel->magic != SUN_LABEL_MAGIC && 124 124 sunlabel->magic != SUN_LABEL_MAGIC_SWAPPED) { … … 128 128 } 129 129 other_endian = (sunlabel->magic == SUN_LABEL_MAGIC_SWAPPED); 130 130 ush = ((unsigned short *) (sunlabel + 1)) - 1; 131 for (csum = 0; ush >= (unsigned short *)sunlabel;) csum ^= *ush--;131 while (ush < (unsigned short *)sunlabel) csum ^= *ush--; 132 132 if (csum) { 133 133 fprintf(stderr,_("Detected sun disklabel with wrong checksum.\n" 134 134 "Probably you'll have to set all the values,\n"
Note:
See TracBrowser
for help on using the repository browser.