~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to fdisk/fdisksgilabel.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
void
133
133
sgi_nolabel() {
134
134
        sgilabel->magic = 0;
135
 
        sgi_label = 0;
136
135
        partitions = 4;
137
136
}
138
137
 
158
157
 
159
158
        if (sgilabel->magic != SGI_LABEL_MAGIC &&
160
159
            sgilabel->magic != SGI_LABEL_MAGIC_SWAPPED) {
161
 
                sgi_label = 0;
162
160
                other_endian = 0;
163
161
                return 0;
164
162
        }
173
171
                        _("Detected sgi disklabel with wrong checksum.\n"));
174
172
        }
175
173
        update_units();
176
 
        sgi_label = 1;
 
174
        disklabel = SGI_LABEL;
177
175
        partitions= 16;
178
176
        volumes = 15;
179
177
        return 1;
325
323
 
326
324
void
327
325
sgi_set_bootfile(const char* aFile) {
328
 
        int i = 0;
329
326
 
330
327
        if (sgi_check_bootfile(aFile)) {
 
328
                size_t i = 0;
331
329
                while (i < 16) {
332
330
                        if ((aFile[i] != '\n')  /* in principle caught again by next line */
333
331
                            &&  (strlen(aFile) > i))
535
533
sgi_change_sysid(int i, int sys)
536
534
{
537
535
        if (sgi_get_num_sectors(i) == 0) /* caught already before, ... */ {
538
 
                printf(_("Sorry You may change the Tag of non-empty partitions.\n"));
 
536
                printf(_("Sorry, only for non-empty partitions you can change the tag.\n"));
539
537
                return 0;
540
538
        }
541
539
        if (((sys != ENTIRE_DISK) && (sys != SGI_VOLHDR))
780
778
        sgilabel->devparam.xylogics_writecont   = SSWAP16(0);
781
779
        memset(&(sgilabel->directory), 0, sizeof(struct volume_directory)*15);
782
780
        memset(&(sgilabel->partitions), 0, sizeof(struct sgi_partition)*16);
783
 
        sgi_label  =  1;
 
781
        disklabel  = SGI_LABEL;
784
782
        partitions = 16;
785
783
        volumes    = 15;
786
784
        sgi_set_entire();