diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-17 00:35:15 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-17 00:35:15 +0000 |
commit | a6163ca355464b34513723b82ba24f0d001d8332 (patch) | |
tree | d848b80df74bc965f990bf88fd5fc68ac46a432b | |
parent | ab47eeee6aeadd5afd78026d34dfcea129e63dce (diff) | |
download | busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.tar.gz busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.tar.bz2 busybox-w32-a6163ca355464b34513723b82ba24f0d001d8332.zip |
install: fix install a b /a/link/to/dir
install: fix -s (strip) option
nmeter: add TODO
-rw-r--r-- | coreutils/install.c | 12 | ||||
-rw-r--r-- | procps/nmeter.c | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/coreutils/install.c b/coreutils/install.c index 7f168d2fd..5503b55cd 100644 --- a/coreutils/install.c +++ b/coreutils/install.c | |||
@@ -102,7 +102,8 @@ int install_main(int argc, char **argv) | |||
102 | opt_complementary = "?:s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); | 102 | opt_complementary = "?:s--d:d--s" USE_SELINUX(":Z--\xff:\xff--Z"); |
103 | /* -c exists for backwards compatibility, it's needed */ | 103 | /* -c exists for backwards compatibility, it's needed */ |
104 | 104 | ||
105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); | 105 | flags = getopt32(argc, argv, "cdpsg:m:o:" USE_SELINUX("Z:"), |
106 | &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); | ||
106 | 107 | ||
107 | #if ENABLE_SELINUX | 108 | #if ENABLE_SELINUX |
108 | if (flags & OPT_PRESERVE_SECURITY_CONTEXT) { | 109 | if (flags & OPT_PRESERVE_SECURITY_CONTEXT) { |
@@ -165,7 +166,8 @@ int install_main(int argc, char **argv) | |||
165 | return ret; | 166 | return ret; |
166 | } | 167 | } |
167 | 168 | ||
168 | isdir = lstat(argv[argc - 1], &statbuf) < 0 ? 0 : S_ISDIR(statbuf.st_mode); | 169 | /* coreutils install resolves link in this case, don't use lstat */ |
170 | isdir = stat(argv[argc - 1], &statbuf) < 0 ? 0 : S_ISDIR(statbuf.st_mode); | ||
169 | 171 | ||
170 | for (i = optind; i < argc - 1; i++) { | 172 | for (i = optind; i < argc - 1; i++) { |
171 | char *dest; | 173 | char *dest; |
@@ -192,7 +194,11 @@ int install_main(int argc, char **argv) | |||
192 | ret = EXIT_FAILURE; | 194 | ret = EXIT_FAILURE; |
193 | } | 195 | } |
194 | if (flags & OPT_STRIP) { | 196 | if (flags & OPT_STRIP) { |
195 | if (BB_EXECLP("strip", "strip", dest, NULL) == -1) { | 197 | char *args[3]; |
198 | args[0] = (char*)"strip"; | ||
199 | args[1] = dest; | ||
200 | args[2] = NULL; | ||
201 | if (spawn_and_wait(args)) { | ||
196 | bb_perror_msg("strip"); | 202 | bb_perror_msg("strip"); |
197 | ret = EXIT_FAILURE; | 203 | ret = EXIT_FAILURE; |
198 | } | 204 | } |
diff --git a/procps/nmeter.c b/procps/nmeter.c index 1d58eb2c1..4f78a1489 100644 --- a/procps/nmeter.c +++ b/procps/nmeter.c | |||
@@ -11,9 +11,14 @@ | |||
11 | // /proc/stat: | 11 | // /proc/stat: |
12 | // disk_io: (3,0):(22272,17897,410702,4375,54750) | 12 | // disk_io: (3,0):(22272,17897,410702,4375,54750) |
13 | // btime 1059401962 | 13 | // btime 1059401962 |
14 | //TODO: use sysinfo libc call/syscall, if appropriate | ||
15 | // (faster than open/read/close): | ||
16 | // sysinfo({uptime=15017, loads=[5728, 15040, 16480] | ||
17 | // totalram=2107416576, freeram=211525632, sharedram=0, bufferram=157204480} | ||
18 | // totalswap=134209536, freeswap=134209536, procs=157}) | ||
14 | 19 | ||
15 | #include "libbb.h" | ||
16 | #include <time.h> | 20 | #include <time.h> |
21 | #include "libbb.h" | ||
17 | 22 | ||
18 | typedef unsigned long long ullong; | 23 | typedef unsigned long long ullong; |
19 | 24 | ||