X-Git-Url: https://git.saurik.com/apple/system_cmds.git/blobdiff_plain/1815bff58803503e37009deeb85cfa8c22acf9d9..ef8ad44b9b5d9c6d8c0fa5b5494f449fb6717387:/zprint.tproj/zprint.c diff --git a/zprint.tproj/zprint.c b/zprint.tproj/zprint.c index 1d030ae..e637a45 100644 --- a/zprint.tproj/zprint.c +++ b/zprint.tproj/zprint.c @@ -39,10 +39,13 @@ */ #include +#include #include #include #include #include +#include +#include #define streql(a, b) (strcmp((a), (b)) == 0) #define strneql(a, b, n) (strncmp((a), (b), (n)) == 0) @@ -71,6 +74,7 @@ usage() exit(1); } +int main(argc, argv) int argc; char *argv[]; @@ -83,11 +87,16 @@ main(argc, argv) unsigned int infoCnt = sizeof info_buf/sizeof info_buf[0]; char *zname = NULL; - int znamelen; + int znamelen = 0; kern_return_t kr; int i, j; + if (0 != reexec_to_match_kernel()) { + fprintf(stderr, "Could not re-execute: %d\n", errno); + exit(1); + } + program = strrchr(argv[0], '/'); if (program == NULL) program = argv[0]; @@ -249,7 +258,7 @@ printzone(name, info) { unsigned int used, size; - printf("%.*s zone:\n", sizeof name->zn_name, name->zn_name); + printf("%.*s zone:\n", (int)sizeof name->zn_name, name->zn_name); printf("\tcur_size: %dK bytes (%d elements)\n", info->zi_cur_size/1024, info->zi_cur_size/info->zi_elem_size); @@ -290,7 +299,7 @@ colprintzone(zone_name, info) zone_info_t *info; { char *name = zone_name->zn_name; - int j, namewidth, retval; + int j, namewidth; unsigned int used, size; namewidth = 25;