aboutsummaryrefslogtreecommitdiff
path: root/procps/kill.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* randomconfig fixesDenys Vlasenko2017-12-311-1/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill: add '--' option to separate options from argumentsRon Yorston2017-08-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using a negative pid to send TERM to a process group results in an obscure error: $ ./busybox kill -12345 kill: bad signal name '12345' This is intended. Manpage says: ARGUMENTS pid Each pid can be one of four things: ... -n where n is larger than 1. All processes in process group n are signaled. When an argument of the form '-n' is given, and it is meant to denote a process group, either a signal must be specified first, or the argument must be preceded by a '--' option, otherwise it will be taken as the signal to send. However, we did not support "--". Add this capability to BusyBox. function old new delta kill_main 993 999 +6 Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* new NOFORKs: pwdx,kill[all5],ttysize,realpath,readlink NOEXECs: date,resizeDenys Vlasenko2017-08-031-5/+5
| | | | | | | | | | 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>
* ash: allow "trap NUM [SIG]..." syntaxDenys Vlasenko2017-07-251-1/+1
| | | | | | | | | | | | | While at it, make get_signum() return -1 for numeric strings >= NSIG. function old new delta trapcmd 292 306 +14 get_signum 295 300 +5 builtin_trap 413 412 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 19/-1) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: deindent all help textsDenys Vlasenko2017-07-211-10/+10
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix errors found with make_single_applets.shDenys Vlasenko2017-04-121-5/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add comment about APPLET_ODDNAME formatDenys Vlasenko2017-01-291-1/+2
| | | | | | It confused me more than once Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill: optimizations for single-applet buildKang-Che Sung2017-01-091-18/+28
| | | | | | | | | | | | | | | | | | | | | | * Fix a bug with a configuration in which the shell's kill builtin would be mistreated as a killall command (i.e. '-q' works, and 'kill process_name' succeeds when it shouldn't): CONFIG_ASH_JOB_CONTROL=y CONFIG_HUSH_KILL=y # CONFIG_KILL is not set CONFIG_KILLALL=y # CONFIG_KILLALL5 is not set * Optimize out unneeded code when the relevant applets are not selected. * Move kbuild lines about shells' kill builtins from Kbuild.src to kill.c, to accompany the new HAVE_SH_KILL macro. I hope this would make maintanence a little bit easier. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill: need not build kill.c when ash's job control is offKang-Che Sung2017-01-091-2/+1
| | | | | | | ash kill builtin depends on the job control config option. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hush: kill builtin and kill %jobspec supportDenys Vlasenko2017-01-081-2/+2
| | | | | | | | | | | | | Also made it and printf, type and wait builtins optional. function old new delta builtin_kill - 323 +323 bltins1 336 348 +12 builtin_type 114 116 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 337/0) Total: 337 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix "kill %1" not working if CONFIG_ASH is disabledKang-Che Sung2017-01-081-1/+2
| | | | | | | | ix ash "kill %1" not working if CONFIG_ASH is disabled but ash is launched by 'sh' or 'bash' name Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Make killall and killall5 selecatable independent from killDenys Vlasenko2016-11-231-8/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Convert all procps/* applets to "new style" applet definitionsDenys Vlasenko2016-11-231-0/+30
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill[all[5]]: code shrinkDenys Vlasenko2013-12-161-20/+18
| | | | | | | function old new delta kill_main 992 947 -45 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* killall5: return 2 if no processes got killedUros Vampl2013-12-161-1/+4
| | | | | | | function old new delta kill_main 943 992 +49 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* killall5: don't do STOP/CONT dance if the signal we send is SIGSTOP or SIGCONTDenys Vlasenko2012-04-031-2/+4
| | | | | | | function old new delta kill_main 913 942 +29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill: fix segfault in arguments parsingAlexey Fomenko2011-12-221-4/+7
| | | | | Signed-off-by: Alexey Fomenko <ext-alexey.fomenko@nokia.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: remove "Options:" string from help textsDenys Vlasenko2011-06-051-3/+0
| | | | | | | function old new delta packed_usage 28706 28623 -83 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move remaining help text from include/usage.src.hPere Orga2011-04-111-0/+39
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* kill: fix infinite loop when passed PIDs are not valid numbersPere Orga2011-03-071-0/+1
| | | | | Signed-off-by: Pere Orga <gotrunks@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ash: fix ash-signals/signal8 testcase failureDenys Vlasenko2011-02-211-3/+22
| | | | | | | | | | | function old new delta killcmd 109 224 +115 kill_main 882 910 +28 changepath 194 195 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 144/0) Total: 144 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nandwrite: complain on malformed -s NUMDenys Vlasenko2010-08-291-2/+2
| | | | | | Elsewhere: use common error message. -30 bytes net size change Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: merge some common stringsDenys Vlasenko2010-03-231-1/+1
| | | | | | | | text data bss dec hexfilename 838650 8009 0 846659 ceb43busybox_old 838519 8009 0 846528 ceac0busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: use "can't" instead of "cannot"Denys Vlasenko2009-11-131-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* function old new deltaDenis Vlasenko2009-02-071-9/+48
| | | | | kill_main 706 884 +178
* kill[all[5]]: accept -s SIG too. kill_main: +29 bytesDenis Vlasenko2008-10-311-3/+7
| | | | | by Steve Bennett (steveb AT workware.net.au)
* more of -Wall fixes from Cristian Ionescu-Idbohrn.Denis Vlasenko2008-05-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some are fixing real bugs. function old new delta syslogd_main 938 958 +20 get_signum 136 143 +7 obj_load 777 782 +5 recv_from_to 210 214 +4 get_next_block 1795 1799 +4 display_topmem_process_list 1117 1121 +4 logread_main 484 487 +3 buffer_fill_and_print 73 76 +3 kill_main 687 689 +2 ll_remember_index 240 241 +1 do_stats 452 453 +1 if_readconf 166 165 -1 display_process_list 1192 1191 -1 run_applet_and_exit 507 505 -2 print_signames 33 31 -2 parse_one_line 1092 1090 -2 find_out_spec 57 55 -2 add_ksymoops_symbols 421 419 -2 ash_main 1407 1402 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes
* shells: do not frocibly enable test, echo and kill _applets_,Denis Vlasenko2008-04-011-1/+0
| | | | | | | | | | | | | | | | | | | just build relevant source and use xxx_main functions. build system: add a special case when we have exactly one applet enabled (makes "true", "false", "basename" REALLY tiny). getopt32: do not use stdio. function old new delta getopt32 1385 1412 +27 make_device 1187 1200 +13 basename_main 120 127 +7 tcpudpsvd_main 1922 1926 +4 testcmd 5 - -5 echocmd 5 - -5 fuser_main 1243 1231 -12 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 4/1 up/down: 51/-22) Total: 29 bytes
* cosmetic change in message textDenis Vlasenko2007-11-151-1/+1
|
* bad syntax error should go to stderrPaul Fox2007-11-141-1/+1
|
* add -fvisibility=hidden to CC flags, mark XXX_main functionsDenis Vlasenko2007-10-111-1/+1
| | | | | EXTERNALLY_VISIBLE. 5% size reduction of libbusybox.so
* print_signames_and_exit -> print_signames (because of "ash calls kill_main")Denis Vlasenko2007-09-301-1/+2
|
* pgrep,pkill: new applets by Loic Grenie <loic.grenie@gmail.com>Denis Vlasenko2007-09-291-26/+22
|
* usage.c: remove reference to busybox.hDenis Vlasenko2007-05-261-1/+1
| | | | | *: s/include "busybox.h"/include "libbb.h"
* kill: improve commentDenis Vlasenko2007-05-061-1/+2
|
* kill: fix recent breakage of vda, also make code smaller by 21 bytes.Denis Vlasenko2007-05-061-5/+12
|
* test: code size saving, no logic changesDenis Vlasenko2007-05-011-1/+3
| | | | | | | | | | | | | | | ps: fix warning, make a bit smaller kill -l: make smaller & know much more signals function old new delta get_signum 121 153 +32 kill_main 826 843 +17 get_signame 44 36 -8 signals 252 224 -28 .rodata 131955 131923 -32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/3 up/down: 49/-68) Total: -19 bytes
* ash,kill: use common code for kill applet/builtinDenis Vlasenko2007-04-291-38/+57
| | | | | | | | | | | | | | | | | | | | | | | | # make bloatcheck function old new delta evaltreenr 644 654 +10 evaltree 644 654 +10 parse_conf 1440 1444 +4 dpkg_deb_main 426 429 +3 ed_main 3319 3321 +2 passwd_main 2093 2091 -2 kill_main 830 826 -4 singlemount 4609 4601 -8 find_command 962 954 -8 get_lcm 123 105 -18 .rodata 132243 132147 -96 killcmd 449 120 -329 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/7 up/down: 29/-465) Total: -436 bytes # size busybox_old busybox_unstripped text data bss dec hex filename 723901 2940 27504 754345 b82a9 busybox_old 723457 2940 27504 753901 b80ed busybox_unstripped
* suppress warnings about easch <applet>_main() havingDenis Vlasenko2007-02-031-0/+1
| | | | no preceding prototype
* whitespace fixes (leading spaces to tab)Denis Vlasenko2007-01-131-1/+1
|
* replace /proc scanning code by more versatile one.Denis Vlasenko2006-11-051-3/+3
| | | | | | | Use it where appropriate. Stop scanning /etc/passwd *for every process*!!! (uid->username) top: reduce memory usage - we won't save unneeded fields from /proc info anymore. Downside: ~+250 bytes of code
* top: improve CPU% calculationDenis Vlasenko2006-11-051-14/+14
| | | | style fixes
* Unneeded code removed, usused field "unsigned pscpu" removedDenis Vlasenko2006-11-011-3/+4
|
* PID should be stored in pid_t, not int or long.Denis Vlasenko2006-11-011-14/+16
| | | | | find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead.
* attempt to regularize atoi mess.Denis Vlasenko2006-10-081-2/+2
|
* bb_applet_name -> applet_nameDenis Vlasenko2006-10-031-4/+4
|
* kill: implement killall5. OpenWRT folks will be happy.Denis Vlasenko2006-09-271-28/+48
| | | | | However their code was unusably different from sysvinit original. Run tested.
* kill: fix bugs (kill -l output was horrible), fix style, constify dataDenis Vlasenko2006-09-271-55/+56
|