*
* Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it)
*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
/*
static const char defaultpro[] ALIGN1 = "/proc/profile";
int readprofile_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int readprofile_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int readprofile_main(int argc UNUSED_PARAM, char **argv)
{
FILE *map;
const char *mapFile, *proFile;
* Use an fd for the profiling buffer, to skip stdio overhead
*/
len = MAXINT(ssize_t);
- buf = xmalloc_open_read_close(proFile, &len);
+ buf = xmalloc_xopen_read_close(proFile, &len);
if (!optNative) {
- int entries = len/sizeof(*buf);
+ int entries = len / sizeof(*buf);
int big = 0, small = 0, i;
unsigned *p;
total = 0;
- map = xfopen(mapFile, "r");
+ map = xfopen_for_read(mapFile);
while (fgets(mapline, S_LEN, map)) {
if (sscanf(mapline, "%llx %s %s", &fn_add, mode, fn_name) != 3)
/* ignore any LEADING (before a '[tT]' symbol is found)
Absolute symbols */
if ((*mode == 'A' || *mode == '?') && total == 0) continue;
- if (*mode != 'T' && *mode != 't' &&
- *mode != 'W' && *mode != 'w')
+ if (*mode != 'T' && *mode != 't'
+ && *mode != 'W' && *mode != 'w'
+ ) {
break; /* only text is profiled */
+ }
if (indx >= len / sizeof(*buf))
bb_error_msg_and_die("profile address out of range. "