aboutsummaryrefslogtreecommitdiff
path: root/util-linux/readprofile.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/readprofile.c')
-rw-r--r--util-linux/readprofile.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/util-linux/readprofile.c b/util-linux/readprofile.c
index 8fe8787ba..aaa419a3c 100644
--- a/util-linux/readprofile.c
+++ b/util-linux/readprofile.c
@@ -4,19 +4,7 @@
4 * 4 *
5 * Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it) 5 * Copyright (C) 1994,1996 Alessandro Rubini (rubini@ipvvis.unipv.it)
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 8 */
21 9
22/* 10/*
@@ -44,17 +32,8 @@
44 * Paul Mundt <lethal@linux-sh.org>. 32 * Paul Mundt <lethal@linux-sh.org>.
45 */ 33 */
46 34
47#include <errno.h>
48#include <stdio.h>
49#include <fcntl.h>
50#include <stdlib.h>
51#include <unistd.h>
52#include <string.h>
53#include <sys/types.h>
54#include <sys/stat.h>
55#include <sys/utsname.h>
56
57#include "busybox.h" 35#include "busybox.h"
36#include <sys/utsname.h>
58 37
59#define S_LEN 128 38#define S_LEN 128
60 39
@@ -138,7 +117,7 @@ int readprofile_main(int argc, char **argv)
138 to_write = 1; /* sth different from sizeof(int) */ 117 to_write = 1; /* sth different from sizeof(int) */
139 } 118 }
140 119
141 fd = bb_xopen(defaultpro,O_WRONLY); 120 fd = xopen(defaultpro,O_WRONLY);
142 121
143 if (write(fd, &multiplier, to_write) != to_write) 122 if (write(fd, &multiplier, to_write) != to_write)
144 bb_perror_msg_and_die("error writing %s", defaultpro); 123 bb_perror_msg_and_die("error writing %s", defaultpro);
@@ -151,7 +130,7 @@ int readprofile_main(int argc, char **argv)
151 * Use an fd for the profiling buffer, to skip stdio overhead 130 * Use an fd for the profiling buffer, to skip stdio overhead
152 */ 131 */
153 132
154 proFd = bb_xopen(proFile,O_RDONLY); 133 proFd = xopen(proFile,O_RDONLY);
155 134
156 if (((int)(len=lseek(proFd,0,SEEK_END)) < 0) 135 if (((int)(len=lseek(proFd,0,SEEK_END)) < 0)
157 || (lseek(proFd,0,SEEK_SET) < 0)) 136 || (lseek(proFd,0,SEEK_SET) < 0))
@@ -198,7 +177,7 @@ int readprofile_main(int argc, char **argv)
198 177
199 total = 0; 178 total = 0;
200 179
201 map = bb_xfopen(mapFile, "r"); 180 map = xfopen(mapFile, "r");
202 181
203 while (fgets(mapline,S_LEN,map)) { 182 while (fgets(mapline,S_LEN,map)) {
204 if (sscanf(mapline,"%llx %s %s",&fn_add,mode,fn_name) != 3) 183 if (sscanf(mapline,"%llx %s %s",&fn_add,mode,fn_name) != 3)