return (unsigned int)(tv.tv_sec + (tv.tv_usec << 12) + getpid());
}
-/* normally O_RDWR, -l option gives O_RDONLY */
-static int type_open = O_RDWR;
-
/*
* Raw disk label. For DOS-type partition tables the MBR,
* with descriptions of the primary partitions.
goto got_dos_table; /* skip reading disk */
if (what != try_only) {
- if ((fd = open(disk_device, type_open)) < 0) {
+ if ((fd = open(disk_device, O_RDWR)) < 0) {
if ((fd = open(disk_device, O_RDONLY)) < 0)
fatal(unable_to_open);
else
if (setjmp(listingbuf))
return;
gpt_warning(device);
- if ((fd = open(disk_device, type_open)) >= 0) {
+ if ((fd = open(disk_device, O_RDONLY)) >= 0) {
gb = get_boot(try_only);
if (gb > 0) { /* I/O error */
} else if (gb < 0) { /* no DOS signature */
if (optl) {
nowarn = 1;
- type_open = O_RDONLY;
if (argc > optind) {
int k;
/* avoid gcc warning:
unsigned long long size;
nowarn = 1;
- type_open = O_RDONLY;
opts = argc - optind;
if (opts <= 0)
for (j = optind; j < argc; j++) {
disk_device = argv[j];
- if ((fd = open(disk_device, type_open)) < 0)
+ if ((fd = open(disk_device, O_RDONLY)) < 0)
fatal(unable_to_open);
if (blkdev_get_sectors(fd, &size) == -1)
fatal(ioctl_error);