* fhandler_proc.cc (format_proc_partitions): Only list recognized

partitions.  Use partition number given by PartitionNumber member.
This commit is contained in:
Corinna Vinschen 2005-06-20 19:58:26 +00:00
parent 7b02cb3038
commit 74041a3a74
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-06-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler_proc.cc (format_proc_partitions): Only list recognized
partitions. Use partition number given by PartitionNumber member.
2005-06-18 Corinna Vinschen <corinna@vinschen.de> 2005-06-18 Corinna Vinschen <corinna@vinschen.de>
* glob.c: (glob0): New local variable `limit`. Use in calls to glob1 * glob.c: (glob0): New local variable `limit`. Use in calls to glob1

View File

@ -1009,10 +1009,11 @@ format_proc_partitions (char *destbuf, size_t maxsize)
DRIVE_LAYOUT_INFORMATION *dli = (DRIVE_LAYOUT_INFORMATION *) buf; DRIVE_LAYOUT_INFORMATION *dli = (DRIVE_LAYOUT_INFORMATION *) buf;
for (unsigned partition = 0; partition < dli->PartitionCount; partition++) for (unsigned partition = 0; partition < dli->PartitionCount; partition++)
{ {
if (!dli->PartitionEntry[partition].PartitionLength.QuadPart) if (!dli->PartitionEntry[partition].PartitionLength.QuadPart
|| !dli->PartitionEntry[partition].RecognizedPartition)
continue; continue;
device dev; device dev;
dev.parsedisk (drive_number, partition + 1); dev.parsedisk (drive_number, dli->PartitionEntry[partition].PartitionNumber);
bufptr += __small_sprintf (bufptr, "%5d %5d %9U %s\n", bufptr += __small_sprintf (bufptr, "%5d %5d %9U %s\n",
dev.major, dev.minor, dev.major, dev.minor,
(long long)(dli->PartitionEntry[partition].PartitionLength.QuadPart >> 10), (long long)(dli->PartitionEntry[partition].PartitionLength.QuadPart >> 10),