aboutsummaryrefslogtreecommitdiff
path: root/procps/sysctl.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /procps/sysctl.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'procps/sysctl.c')
-rw-r--r--procps/sysctl.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/procps/sysctl.c b/procps/sysctl.c
index 5673d293f..03a03889e 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -15,15 +15,6 @@
15 */ 15 */
16 16
17#include "busybox.h" 17#include "busybox.h"
18#include <stdio.h>
19#include <stdlib.h>
20#include <unistd.h>
21#include <sys/stat.h>
22#include <sys/types.h>
23#include <dirent.h>
24#include <string.h>
25#include <errno.h>
26#include <fcntl.h>
27 18
28/* 19/*
29 * Function Prototypes 20 * Function Prototypes
@@ -202,8 +193,8 @@ int sysctl_write_setting(const char *setting, int output)
202 return -2; 193 return -2;
203 } 194 }
204 195
205 tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name); 196 tmpname = xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name);
206 outname = bb_xstrdup(tmpname + strlen(PROC_PATH)); 197 outname = xstrdup(tmpname + strlen(PROC_PATH));
207 198
208 while ((cptr = strchr(tmpname, '.')) != NULL) 199 while ((cptr = strchr(tmpname, '.')) != NULL)
209 *cptr = '/'; 200 *cptr = '/';
@@ -258,7 +249,7 @@ int sysctl_read_setting(const char *setting, int output)
258 bb_error_msg(ERR_INVALID_KEY, setting); 249 bb_error_msg(ERR_INVALID_KEY, setting);
259 250
260 tmpname = concat_path_file(PROC_PATH, name); 251 tmpname = concat_path_file(PROC_PATH, name);
261 outname = bb_xstrdup(tmpname + strlen(PROC_PATH)); 252 outname = xstrdup(tmpname + strlen(PROC_PATH));
262 253
263 while ((cptr = strchr(tmpname, '.')) != NULL) 254 while ((cptr = strchr(tmpname, '.')) != NULL)
264 *cptr = '/'; 255 *cptr = '/';
@@ -309,7 +300,7 @@ int sysctl_display_all(const char *path, int output, int show_table)
309 char *tmpdir; 300 char *tmpdir;
310 struct stat ts; 301 struct stat ts;
311 302
312 if (!(dp = bb_opendir(path))) { 303 if (!(dp = opendir(path))) {
313 retval = -1; 304 retval = -1;
314 } else { 305 } else {
315 while ((de = readdir(dp)) != NULL) { 306 while ((de = readdir(dp)) != NULL) {