busybox/shell/hush_test/hush-comm/comm.tests
Denys Vlasenko 5acf5e1f87 shell: fix script's comm field if ENABLE_FEATURE_PREFER_APPLETS=y
function                                             old     new   delta
re_execed_comm                                         -      46     +46
main                                                  72      86     +14
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 60/0)               Total: 60 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2021-10-11 18:44:00 +02:00

21 lines
449 B
Plaintext
Executable File

{
echo "#!$THIS_SH"
echo 'procdir=/proc/$$'
#echo 'echo " /proc/N/exe: $(basename $(readlink $procdir/exe))"'
echo 'echo " /proc/N/comm: $(cat $procdir/comm)"'
} >SCRIPT.sh
chmod 755 SCRIPT.sh
# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
echo './SCRIPT.sh:'
./SCRIPT.sh
# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
echo 'exec ./SCRIPT.sh:'
(exec ./SCRIPT.sh)
echo 'sh ./SCRIPT.sh:'
$THIS_SH ./SCRIPT.sh
rm SCRIPT.sh