Mercurial > hg > toybox
comparison toys/posix/df.c @ 689:c29e69a0e85e
On 32 bit platforms %ld doesn't match uint64_t, so do long long and %lld (rather than deal with verbose PRIu64 nonsense).
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 10 Nov 2012 18:24:14 -0600 |
parents | 598263aee2b9 |
children | 786841fdb1e0 |
comparison
equal
deleted
inserted
replaced
688:9791e462855a | 689:c29e69a0e85e |
---|---|
47 ) | 47 ) |
48 | 48 |
49 static void show_mt(struct mtab_list *mt) | 49 static void show_mt(struct mtab_list *mt) |
50 { | 50 { |
51 int len; | 51 int len; |
52 uint64_t size, used, avail, percent, block; | 52 long long size, used, avail, percent, block; |
53 char *device; | 53 char *device; |
54 | 54 |
55 // Return if it wasn't found (should never happen, but with /etc/mtab...) | 55 // Return if it wasn't found (should never happen, but with /etc/mtab...) |
56 if (!mt) return; | 56 if (!mt) return; |
57 | 57 |
86 | 86 |
87 // Figure out appropriate spacing | 87 // Figure out appropriate spacing |
88 len = 25 - strlen(device); | 88 len = 25 - strlen(device); |
89 if (len < 1) len = 1; | 89 if (len < 1) len = 1; |
90 if (CFG_DF_PEDANTIC && (toys.optflags & FLAG_P)) { | 90 if (CFG_DF_PEDANTIC && (toys.optflags & FLAG_P)) { |
91 xprintf("%s %ld %ld %ld %ld%% %s\n", device, size, used, avail, | 91 xprintf("%s %lld %lld %lld %lld%% %s\n", device, size, used, avail, |
92 percent, mt->dir); | 92 percent, mt->dir); |
93 } else { | 93 } else { |
94 xprintf("%s% *ld % 10ld % 9ld % 3ld%% %s\n", device, len, | 94 xprintf("%s% *lld % 10lld % 9lld % 3lld%% %s\n", device, len, |
95 size, used, avail, percent, mt->dir); | 95 size, used, avail, percent, mt->dir); |
96 } | 96 } |
97 | 97 |
98 if (device != mt->device) free(device); | 98 if (device != mt->device) free(device); |
99 } | 99 } |