summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenis Vlasenko2006-12-26 10:42:51 +0000
committerDenis Vlasenko2006-12-26 10:42:51 +0000
commitbf0a201008671f81c107de72c026b1b84967561d (patch)
treeaf74820b70fa27929fe218c95822c20651b60637 /libbb
parent5dd7ef0f37373e397a7160cb431a32ae57f9f7d9 (diff)
downloadbusybox-bf0a201008671f81c107de72c026b1b84967561d.zip
busybox-bf0a201008671f81c107de72c026b1b84967561d.tar.gz
style fixes
last xcalloc replaced by xzalloc
Diffstat (limited to 'libbb')
-rw-r--r--libbb/dump.c2
-rw-r--r--libbb/find_root_device.c7
-rw-r--r--libbb/sha1.c2
-rw-r--r--libbb/vfork_daemon_rexec.c8
4 files changed, 8 insertions, 11 deletions
diff --git a/libbb/dump.c b/libbb/dump.c
index 06b73c9..1815ca9 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -726,7 +726,7 @@ void bb_dump_add(const char *fmt)
if (isdigit(*p)) {
// TODO: use bb_strtou
savep = p;
- do p++; while(isdigit(*p));
+ do p++; while (isdigit(*p));
if (!isspace(*p)) {
bb_error_msg_and_die("bad format {%s}", fmt);
}
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index 71b79b8..1d74d1e 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -17,12 +17,13 @@ char *find_block_device(char *path)
dev_t dev;
char *retpath=NULL;
- if(stat(path, &st) || !(dir = opendir("/dev"))) return NULL;
+ if (stat(path, &st) || !(dir = opendir("/dev")))
+ return NULL;
dev = (st.st_mode & S_IFMT) == S_IFBLK ? st.st_rdev : st.st_dev;
- while((entry = readdir(dir)) != NULL) {
+ while ((entry = readdir(dir)) != NULL) {
char devpath[PATH_MAX];
sprintf(devpath,"/dev/%s", entry->d_name);
- if(!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
+ if (!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) {
retpath = xstrdup(devpath);
break;
}
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 34813e2..734fde4 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -47,7 +47,7 @@
do { \
t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \
e = d; d = c; c = rotl32(b, 30); b = t; \
- } while(0)
+ } while (0)
static void sha1_compile(sha1_ctx_t *ctx)
{
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index ebd32f8..81ae126 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -15,13 +15,9 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
#include <paths.h>
#include "libbb.h"
-
#ifdef BB_NOMMU
void vfork_daemon_rexec(int nochdir, int noclose,
int argc, char **argv, char *foreground_opt)
@@ -43,9 +39,9 @@ void vfork_daemon_rexec(int nochdir, int noclose,
close(fd);
}
- vfork_args = xcalloc(sizeof(char *), argc + 3);
+ vfork_args = xzalloc(sizeof(char *) * (argc + 3));
vfork_args[a++] = CONFIG_BUSYBOX_EXEC_PATH;
- while(*argv) {
+ while (*argv) {
vfork_args[a++] = *argv;
argv++;
}