summaryrefslogtreecommitdiff
path: root/procps/sysctl.c
diff options
context:
space:
mode:
authorRob Landley2006-08-03 15:41:12 +0000
committerRob Landley2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /procps/sysctl.c
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
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 5673d29..03a0388 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -15,15 +15,6 @@
*/
#include "busybox.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
/*
* Function Prototypes
@@ -202,8 +193,8 @@ int sysctl_write_setting(const char *setting, int output)
return -2;
}
- tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name);
- outname = bb_xstrdup(tmpname + strlen(PROC_PATH));
+ tmpname = xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name);
+ outname = xstrdup(tmpname + strlen(PROC_PATH));
while ((cptr = strchr(tmpname, '.')) != NULL)
*cptr = '/';
@@ -258,7 +249,7 @@ int sysctl_read_setting(const char *setting, int output)
bb_error_msg(ERR_INVALID_KEY, setting);
tmpname = concat_path_file(PROC_PATH, name);
- outname = bb_xstrdup(tmpname + strlen(PROC_PATH));
+ outname = xstrdup(tmpname + strlen(PROC_PATH));
while ((cptr = strchr(tmpname, '.')) != NULL)
*cptr = '/';
@@ -309,7 +300,7 @@ int sysctl_display_all(const char *path, int output, int show_table)
char *tmpdir;
struct stat ts;
- if (!(dp = bb_opendir(path))) {
+ if (!(dp = opendir(path))) {
retval = -1;
} else {
while ((de = readdir(dp)) != NULL) {