projects
/
part-list.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8a6797
)
Flush stdout before writing Done to stderr, and make 'type' 3 columns wide
master
author
TJ
<ubuntu@tjworld.net>
Sun, 14 Nov 2010 00:10:18 +0000
(
00:10
+0000)
committer
TJ
<ubuntu@tjworld.net>
Sun, 14 Nov 2010 00:10:18 +0000
(
00:10
+0000)
part-list.c
patch
|
blob
|
history
diff --git
a/part-list.c
b/part-list.c
index
1128cae
..
0a6324d
100644
(file)
--- a/
part-list.c
+++ b/
part-list.c
@@
-111,9
+111,9
@@
main(int argc, char *argv[], char *env[]) {
}
{
char fmt_spec[100];
}
{
char fmt_spec[100];
- char *format[2][
4
] = {
- { "%8lX", "%08lX", "%02X", "%04X" },
- { "%8ld", "%10ld", "%2d", "%4d" }
+ char *format[2][
5
] = {
+ { "%8lX", "%08lX", "%02X", "%04X"
, "%03X"
},
+ { "%8ld", "%10ld", "%2d", "%4d"
, "%3d"
}
};
struct partition_table pt_table[4];
unsigned long offset, found;
};
struct partition_table pt_table[4];
unsigned long offset, found;
@@
-144,7
+144,7
@@
main(int argc, char *argv[], char *env[]) {
pt_table[pt_entry].count_LBA = *(unsigned int *)(pt_mmap + pt_offset + PT_BASE + PT_COUNT_LBA);
sprintf(fmt_spec, "%%d %%s %s %s %s %s %s %s %s %s %s (next %s)\n",
pt_table[pt_entry].count_LBA = *(unsigned int *)(pt_mmap + pt_offset + PT_BASE + PT_COUNT_LBA);
sprintf(fmt_spec, "%%d %%s %s %s %s %s %s %s %s %s %s (next %s)\n",
- format[use_decimal][
2
], // type
+ format[use_decimal][
4
], // type
format[use_decimal][3], // cyl
format[use_decimal][2], // head
format[use_decimal][2], // sector
format[use_decimal][3], // cyl
format[use_decimal][2], // head
format[use_decimal][2], // sector
@@
-172,6
+172,7
@@
main(int argc, char *argv[], char *env[]) {
}
}
}
}
}
}
+ fflush(stdout);
fprintf(stderr, "Done.\n");
}
}
fprintf(stderr, "Done.\n");
}
}