bin/df: Fix format strings through B_PRI macros
This commit is contained in:
parent
93407f0c87
commit
deb9fbcb85
|
@ -69,7 +69,7 @@ ByteString(int64 numBlocks, int64 blockSize)
|
||||||
static char string[64];
|
static char string[64];
|
||||||
|
|
||||||
if (blocks < 1024)
|
if (blocks < 1024)
|
||||||
sprintf(string, "%Ld", numBlocks * blockSize);
|
sprintf(string, "%" B_PRId64, numBlocks * blockSize);
|
||||||
else {
|
else {
|
||||||
const char *units[] = {"K", "M", "G", NULL};
|
const char *units[] = {"K", "M", "G", NULL};
|
||||||
int32 i = -1;
|
int32 i = -1;
|
||||||
|
@ -92,7 +92,7 @@ PrintBlocks(int64 blocks, int64 blockSize, bool showBlocks)
|
||||||
char temp[1024];
|
char temp[1024];
|
||||||
|
|
||||||
if (showBlocks)
|
if (showBlocks)
|
||||||
sprintf(temp, "%Ld", blocks * (blockSize / 1024));
|
sprintf(temp, "%" B_PRId64, blocks * (blockSize / 1024));
|
||||||
else
|
else
|
||||||
strcpy(temp, ByteString(blocks, blockSize));
|
strcpy(temp, ByteString(blocks, blockSize));
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ PrintVerbose(dev_t device)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" Device No.: %ld\n", info.dev);
|
printf(" Device No.: %" B_PRIdDEV "\n", info.dev);
|
||||||
PrintMountPoint(info.dev, true);
|
PrintMountPoint(info.dev, true);
|
||||||
printf(" Volume Name: \"%s\"\n", info.volume_name);
|
printf(" Volume Name: \"%s\"\n", info.volume_name);
|
||||||
printf(" File System: %s\n", info.fsh_name);
|
printf(" File System: %s\n", info.fsh_name);
|
||||||
|
@ -124,13 +124,17 @@ PrintVerbose(dev_t device)
|
||||||
PrintFlag(info.flags, B_FS_IS_REMOVABLE, "R", "-");
|
PrintFlag(info.flags, B_FS_IS_REMOVABLE, "R", "-");
|
||||||
PrintFlag(info.flags, B_FS_IS_READONLY, "-", "W");
|
PrintFlag(info.flags, B_FS_IS_READONLY, "-", "W");
|
||||||
|
|
||||||
printf("\n I/O Size: %10s (%Ld byte)\n", ByteString(info.io_size, 1), info.io_size);
|
printf("\n I/O Size: %10s (%" B_PRIdOFF " byte)\n",
|
||||||
printf(" Block Size: %10s (%Ld byte)\n", ByteString(info.block_size, 1), info.block_size);
|
ByteString(info.io_size, 1), info.io_size);
|
||||||
printf(" Total Blocks: %10s (%Ld blocks)\n", ByteString(info.total_blocks, info.block_size), info.total_blocks);
|
printf(" Block Size: %10s (%" B_PRIdOFF " byte)\n",
|
||||||
printf(" Free Blocks: %10s (%Ld blocks)\n", ByteString(info.free_blocks, info.block_size), info.free_blocks);
|
ByteString(info.block_size, 1), info.block_size);
|
||||||
printf(" Total Nodes: %Ld\n", info.total_nodes);
|
printf(" Total Blocks: %10s (%" B_PRIdOFF " blocks)\n",
|
||||||
printf(" Free Nodes: %Ld\n", info.free_nodes);
|
ByteString(info.total_blocks, info.block_size), info.total_blocks);
|
||||||
printf(" Root Inode: %Ld\n", info.root);
|
printf(" Free Blocks: %10s (%" B_PRIdOFF " blocks)\n",
|
||||||
|
ByteString(info.free_blocks, info.block_size), info.free_blocks);
|
||||||
|
printf(" Total Nodes: %" B_PRIdOFF "\n", info.total_nodes);
|
||||||
|
printf(" Free Nodes: %" B_PRIdOFF "\n", info.free_nodes);
|
||||||
|
printf(" Root Inode: %" B_PRIdINO "\n", info.root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue