On 05/04/2011 06:23 AM, Laine Stump wrote:
This definitely fixes the FILE* leak, but do we really want to abort
the loop (stop looking for more pidfiles) when fscanf fails on one
pidfile? (dunno, just asking)
Personally, I think that since pidfiles are always generated by the
kernel, they should always have sane contents, so failure to read them
means something is really wrong. The fact that the overall function
returns -1, right away, rather than trying to read other pid files (if
any), is in some regards a feature (if we're having problems reading one
pid file, then what else is going wrong?). Furthermore, there were
other places in the loop that aborted on the first failure, so this
isn't the first case of aborting the outer loop if the inner loop fails.