[BusyBox] busybox-0.60.1 pidof return exit code

Robert Griebl griebl at gmx.de
Thu May 16 13:42:04 UTC 2002


Am Donnerstag, 16. Mai 2002 21:19 schrieben Sie:
> We found that code currently in pidof.c aloways
> returns 0( EXT_SUCCESS ) to the calling process.
> This makes in impossible to use pidof in
> scripts that require an exit status
> to determine if pidof suceeded.
> We suggest that the following lines in
> pidof.c at about line number 77 be changed
> from:
>     printf("\n");
>     return EXIT_SUCCESS;
> to:
>     printf("\n");
>     if (fail) return EXIT_FAILURE;
>     return EXIT_SUCCESS;
>
> We were wondering if there is a reason why the
> current version of pidof behaves this way.
> It does not appear to be POSIX compliant.
>

I have modified the patch a bit and also added the -s flag (only one pid). I 
also made the return code SysV compliant (no process name is ok)

Any objections against it being applied to CVS Head ?

-- 
cu
Robert

--
Real programmers dont write documentation -
leave that to the maintenance people.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pidof.patch
Type: text/x-diff
Size: 1393 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020516/3e4bf84b/attachment.bin 


More information about the busybox mailing list