- change llist_add_to_end as proposed by vodz in http://busybox.net/lists/busybox/2005-September/016411.html
- remove unneeded includes, add short boilerplate and copyright to llist.c
- move COMM_LEN from find_pid_by_name to libbb.h and use it in procps_status_t
- add reverse_pidlist() to find_pid_by_name. Will be needed for pidof.
I've reported this bug in April and it still
exists in 1.00-pre2. So I made patches for
both 0.60.x and 1.00-pre2. The patch is very
simple, just use strncmp instead of strcmp.
Please apply if it is OK.
Here's the procedure to test this problem:
Create a executable with very long name, say
'test_1234567890123456' and execute it. Try
using 'killall' or 'pidof' to find/kill this
program. Without this patch, you can't find
the program.
that into a pid_t, which is unsigned on a number archs. Furthermore,
find_pid_by_name() would _never_ return an error if the intended proces
was "init", but instead would return 1, meaning we would fail to work
on 2.4.x kernels running an initrd...
-Erik