On Sun, 2 May 2010, Denys Vlasenko wrote:

> How about this then?
>
>         result = execute(
>                 "test -f /var/run/udhcpc.%iface%.pid && "
>                 "kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null",
>                 ifd, exec);

Save one 'cat' fork?

Could that be done this way:

        result = execute(
                "f=/var/run/udhcpc.%iface%.pid && "
                "test -r $f && "
                "read p < $f && "
                "kill $p 2>/dev/null",
                ifd, exec);

which will use less resources?

I see there are 2 other places in networking/ifupdown.c where a 'cat'
is forked :)


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to