* fhandler_proc.cc (format_proc_partitions): Use new device code
to get major and minor device numbers. Fix size evaluation.
This commit is contained in:
parent
a3f95116e3
commit
f49c14a197
|
@ -1,3 +1,8 @@
|
||||||
|
2003-10-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_proc.cc (format_proc_partitions): Use new device code
|
||||||
|
to get major and minor device numbers. Fix size evaluation.
|
||||||
|
|
||||||
2003-10-22 Corinna Vinschen <corinna@vinschen.de>
|
2003-10-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR
|
* external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR
|
||||||
|
|
|
@ -898,12 +898,16 @@ format_proc_partitions (char *destbuf, size_t maxsize)
|
||||||
debug_printf ("DeviceIoControl %E");
|
debug_printf ("DeviceIoControl %E");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bufptr += __small_sprintf (bufptr, "%5d %5d %9U sd%c\n",
|
char devname[16];
|
||||||
FH_FLOPPY,
|
__small_sprintf (devname, "/dev/sd%c", drive_number + 'a');
|
||||||
drive_number * 16 + 32,
|
device dev;
|
||||||
|
dev.parse (devname);
|
||||||
|
bufptr += __small_sprintf (bufptr, "%5d %5d %9U %s\n",
|
||||||
|
dev.major,
|
||||||
|
dev.minor,
|
||||||
(long long)((dg.Cylinders.QuadPart * dg.TracksPerCylinder *
|
(long long)((dg.Cylinders.QuadPart * dg.TracksPerCylinder *
|
||||||
dg.SectorsPerTrack * dg.BytesPerSector) >> 6),
|
dg.SectorsPerTrack * dg.BytesPerSector) >> 10),
|
||||||
drive_number + 'a');
|
devname + 5);
|
||||||
}
|
}
|
||||||
while (dwRetCode = DeviceIoControl (hDevice,
|
while (dwRetCode = DeviceIoControl (hDevice,
|
||||||
IOCTL_DISK_GET_DRIVE_LAYOUT,
|
IOCTL_DISK_GET_DRIVE_LAYOUT,
|
||||||
|
@ -924,12 +928,16 @@ format_proc_partitions (char *destbuf, size_t maxsize)
|
||||||
{
|
{
|
||||||
if (dli->PartitionEntry[partition].PartitionLength.QuadPart == 0)
|
if (dli->PartitionEntry[partition].PartitionLength.QuadPart == 0)
|
||||||
continue;
|
continue;
|
||||||
bufptr += __small_sprintf (bufptr, "%5d %5d %9U sd%c%d\n",
|
char devname[16];
|
||||||
FH_FLOPPY,
|
__small_sprintf (devname, "/dev/sd%c%d",
|
||||||
drive_number * 16 + partition + 33,
|
|
||||||
(long long)(dli->PartitionEntry[partition].PartitionLength.QuadPart >> 6),
|
|
||||||
drive_number + 'a',
|
drive_number + 'a',
|
||||||
partition + 1);
|
partition + 1);
|
||||||
|
device dev;
|
||||||
|
dev.parse (devname);
|
||||||
|
bufptr += __small_sprintf (bufptr, "%5d %5d %9U %s\n",
|
||||||
|
dev.major, dev.minor,
|
||||||
|
(long long)(dli->PartitionEntry[partition].PartitionLength.QuadPart >> 10),
|
||||||
|
devname + 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue