diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-26 10:42:51 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-26 10:42:51 +0000 |
commit | 52f326a239527e7242321661d2ba06b50daa3c43 (patch) | |
tree | af74820b70fa27929fe218c95822c20651b60637 /libbb | |
parent | da5e86c349488f3ea31718b149ce9f0d1493b64b (diff) | |
download | busybox-w32-52f326a239527e7242321661d2ba06b50daa3c43.tar.gz busybox-w32-52f326a239527e7242321661d2ba06b50daa3c43.tar.bz2 busybox-w32-52f326a239527e7242321661d2ba06b50daa3c43.zip |
style fixes
last xcalloc replaced by xzalloc
git-svn-id: svn://busybox.net/trunk/busybox@17081 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/dump.c | 2 | ||||
-rw-r--r-- | libbb/find_root_device.c | 7 | ||||
-rw-r--r-- | libbb/sha1.c | 2 | ||||
-rw-r--r-- | libbb/vfork_daemon_rexec.c | 8 |
4 files changed, 8 insertions, 11 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 06b73c955..1815ca914 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -726,7 +726,7 @@ void bb_dump_add(const char *fmt) | |||
726 | if (isdigit(*p)) { | 726 | if (isdigit(*p)) { |
727 | // TODO: use bb_strtou | 727 | // TODO: use bb_strtou |
728 | savep = p; | 728 | savep = p; |
729 | do p++; while(isdigit(*p)); | 729 | do p++; while (isdigit(*p)); |
730 | if (!isspace(*p)) { | 730 | if (!isspace(*p)) { |
731 | bb_error_msg_and_die("bad format {%s}", fmt); | 731 | bb_error_msg_and_die("bad format {%s}", fmt); |
732 | } | 732 | } |
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c index 71b79b8d0..1d74d1ea8 100644 --- a/libbb/find_root_device.c +++ b/libbb/find_root_device.c | |||
@@ -17,12 +17,13 @@ char *find_block_device(char *path) | |||
17 | dev_t dev; | 17 | dev_t dev; |
18 | char *retpath=NULL; | 18 | char *retpath=NULL; |
19 | 19 | ||
20 | if(stat(path, &st) || !(dir = opendir("/dev"))) return NULL; | 20 | if (stat(path, &st) || !(dir = opendir("/dev"))) |
21 | return NULL; | ||
21 | dev = (st.st_mode & S_IFMT) == S_IFBLK ? st.st_rdev : st.st_dev; | 22 | dev = (st.st_mode & S_IFMT) == S_IFBLK ? st.st_rdev : st.st_dev; |
22 | while((entry = readdir(dir)) != NULL) { | 23 | while ((entry = readdir(dir)) != NULL) { |
23 | char devpath[PATH_MAX]; | 24 | char devpath[PATH_MAX]; |
24 | sprintf(devpath,"/dev/%s", entry->d_name); | 25 | sprintf(devpath,"/dev/%s", entry->d_name); |
25 | if(!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) { | 26 | if (!stat(devpath, &st) && S_ISBLK(st.st_mode) && st.st_rdev == dev) { |
26 | retpath = xstrdup(devpath); | 27 | retpath = xstrdup(devpath); |
27 | break; | 28 | break; |
28 | } | 29 | } |
diff --git a/libbb/sha1.c b/libbb/sha1.c index 34813e24a..734fde4c5 100644 --- a/libbb/sha1.c +++ b/libbb/sha1.c | |||
@@ -47,7 +47,7 @@ | |||
47 | do { \ | 47 | do { \ |
48 | t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \ | 48 | t = a; a = rotl32(a,5) + f(b,c,d) + e + k + w[i]; \ |
49 | e = d; d = c; c = rotl32(b, 30); b = t; \ | 49 | e = d; d = c; c = rotl32(b, 30); b = t; \ |
50 | } while(0) | 50 | } while (0) |
51 | 51 | ||
52 | static void sha1_compile(sha1_ctx_t *ctx) | 52 | static void sha1_compile(sha1_ctx_t *ctx) |
53 | { | 53 | { |
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index ebd32f8cd..81ae12687 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c | |||
@@ -15,13 +15,9 @@ | |||
15 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 15 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <unistd.h> | ||
19 | #include <stdio.h> | ||
20 | #include <fcntl.h> | ||
21 | #include <paths.h> | 18 | #include <paths.h> |
22 | #include "libbb.h" | 19 | #include "libbb.h" |
23 | 20 | ||
24 | |||
25 | #ifdef BB_NOMMU | 21 | #ifdef BB_NOMMU |
26 | void vfork_daemon_rexec(int nochdir, int noclose, | 22 | void vfork_daemon_rexec(int nochdir, int noclose, |
27 | int argc, char **argv, char *foreground_opt) | 23 | int argc, char **argv, char *foreground_opt) |
@@ -43,9 +39,9 @@ void vfork_daemon_rexec(int nochdir, int noclose, | |||
43 | close(fd); | 39 | close(fd); |
44 | } | 40 | } |
45 | 41 | ||
46 | vfork_args = xcalloc(sizeof(char *), argc + 3); | 42 | vfork_args = xzalloc(sizeof(char *) * (argc + 3)); |
47 | vfork_args[a++] = CONFIG_BUSYBOX_EXEC_PATH; | 43 | vfork_args[a++] = CONFIG_BUSYBOX_EXEC_PATH; |
48 | while(*argv) { | 44 | while (*argv) { |
49 | vfork_args[a++] = *argv; | 45 | vfork_args[a++] = *argv; |
50 | argv++; | 46 | argv++; |
51 | } | 47 | } |