cant cancel Issues

Russ Allbery rra at stanford.edu
Wed Feb 6 05:51:31 UTC 2002


Jeffrey M Vinocur <jeff at litech.org> writes:

> I will test your patch.

> -       if (unlink(linkpath) < 0) result = FALSE;
> +	(void)unlink(linkpath);

> Do we want instead to do this, though?

> -       if (unlink(linkpath) < 0) result = FALSE;
> +	if (unlink(linkpath) < 0 && i == 1) result = FALSE;

We shouldn't discard all errors, only the error of unlinking a file that's
already been unlinked, yes?  In other words, don't we want instead:

    /* Only consider unlink failure an error if it's for a reason other
       than the file not existing or if the article is not crossposted. */
    if (unlink(linkpath) < 0)
        if (errno != ENOENT || i == 1)
            result = FALSE;

(And in current, use false instead of FALSE.)

In general, I have a minor preference for putting the body of the if
statement on a second line even when it's short, primarily because it
helps code coverage tools like purecov produce more accurate results.
(That's a change from my previous coding style.)

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list