diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-03 19:00:01 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-03 19:03:32 +0200 |
commit | 39194f030918b87eeb3e11e94cfa05f575fb47b4 (patch) | |
tree | 97ea35e2c5984c5c6757ff9a540630ada4b234d5 /procps/pwdx.c | |
parent | 663ae52676eae3b0fdc6bb968ff6497279a034a4 (diff) | |
download | busybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.tar.gz busybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.tar.bz2 busybox-w32-39194f030918b87eeb3e11e94cfa05f575fb47b4.zip |
new NOFORKs: pwdx,kill[all5],ttysize,realpath,readlink NOEXECs: date,resize
function old new delta
run_nofork_applet 258 280 +22
readlink_main 112 123 +11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps/pwdx.c')
-rw-r--r-- | procps/pwdx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/procps/pwdx.c b/procps/pwdx.c index dac238950..84802bbcd 100644 --- a/procps/pwdx.c +++ b/procps/pwdx.c | |||
@@ -14,7 +14,7 @@ | |||
14 | //config: help | 14 | //config: help |
15 | //config: Report current working directory of a process | 15 | //config: Report current working directory of a process |
16 | 16 | ||
17 | //applet:IF_PWDX(APPLET(pwdx, BB_DIR_USR_BIN, BB_SUID_DROP)) | 17 | //applet:IF_PWDX(APPLET_NOFORK(pwdx, pwdx, BB_DIR_USR_BIN, BB_SUID_DROP, pwdx)) |
18 | 18 | ||
19 | //kbuild:lib-$(CONFIG_PWDX) += pwdx.o | 19 | //kbuild:lib-$(CONFIG_PWDX) += pwdx.o |
20 | 20 | ||
@@ -50,6 +50,7 @@ int pwdx_main(int argc UNUSED_PARAM, char **argv) | |||
50 | 50 | ||
51 | sprintf(buf, "/proc/%u/cwd", pid); | 51 | sprintf(buf, "/proc/%u/cwd", pid); |
52 | 52 | ||
53 | /* NOFORK: only one alloc is allowed; must free */ | ||
53 | s = xmalloc_readlink(buf); | 54 | s = xmalloc_readlink(buf); |
54 | // "pwdx /proc/1" says "/proc/1: DIR", not "1: DIR" | 55 | // "pwdx /proc/1" says "/proc/1: DIR", not "1: DIR" |
55 | printf("%s: %s\n", *argv, s ? s : strerror(errno == ENOENT ? ESRCH : errno)); | 56 | printf("%s: %s\n", *argv, s ? s : strerror(errno == ENOENT ? ESRCH : errno)); |