~ubuntu-branches/debian/jessie/scsitools/jessie

« back to all changes in this revision

Viewing changes to scsiinfo/scsiformat.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Delaunay
  • Date: 2004-06-25 00:59:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040625005911-i79gju5vgdxcqd7c
Tags: 0.7-2
* Fixed scsiformat bug.  Closes: #251426.
  Thanks to Erik Mouw <erik@harddisk-recovery.com> for providing a patch.
* Fixed not detected removable devices in scsiinfo.  Closes: #255715.
* Added italian template translations.  Closes: #251740.
* Renamed ca_ES.po to ca.po as there is no need in specifying a country part
  for the Catalan language.  Closes: #255875.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <sys/swap.h>
49
49
#include <sys/mount.h>
50
50
#include <linux/hdreg.h>
51
 
#include <linux/genhd.h>
 
51
 
 
52
struct partition {
 
53
        unsigned char boot_ind;         /* 0x80 - active */
 
54
        unsigned char head;             /* starting head */
 
55
        unsigned char sector;           /* starting sector */
 
56
        unsigned char cyl;              /* starting cylinder */
 
57
        unsigned char sys_ind;          /* What partition type */
 
58
        unsigned char end_head;         /* end head */
 
59
        unsigned char end_sector;       /* end sector */
 
60
        unsigned char end_cyl;          /* end cylinder */
 
61
        unsigned int start_sect;        /* starting sector counting from 0 */
 
62
        unsigned int nr_sects;          /* nr of sectors in partition */
 
63
} __attribute__((packed));
52
64
 
53
65
#define TEST_UNIT_READY (0x00)
54
66
#define FORMAT_UNIT     (0x04)
445
457
    if (par_erasedefs)
446
458
        cmd[1] |= 0x08;
447
459
    if (par_initpattern[0] | par_initpattern[1]) {
448
 
        data[0] |= 0x08;
 
460
        data[1] |= 0x08;
449
461
        par_fov = 1;
450
462
        memcpy(end, par_initpattern, par_patternlen);
451
463
        end += par_patternlen;
452
464
    }
453
465
    if (par_fov) {
454
466
        hasdata = 1;
455
 
        data[0] |= 0x80;
 
467
        data[1] |= 0x80;
456
468
        if (par_disprim)
457
 
            data[0] |= 0x40;
 
469
            data[1] |= 0x40;
458
470
        if (par_discert)
459
 
            data[0] |= 0x20;
 
471
            data[1] |= 0x20;
460
472
        if (par_stop)
461
 
            data[0] |= 0x10;
 
473
            data[1] |= 0x10;
462
474
        if (par_dissav)
463
 
            data[0] |= 0x04;
 
475
            data[1] |= 0x04;
464
476
    }
465
477
    if (!par_blockmode) {
466
 
        data[0] |= 2;
 
478
        data[1] |= 2;
467
479
        hasdata = 1;
468
480
    }
469
481
    if (par_defectlen) {