[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exit status patch for coreutils
From: |
Jim Meyering |
Subject: |
Re: exit status patch for coreutils |
Date: |
Thu, 22 Jan 2004 23:23:44 +0100 |
Paul Eggert <address@hidden> wrote:
> Here's a proposed patch that's been lurking in my archives for a
> while. I audited all the use of exit statuses in coreutils, and found
> some problems. The worst example:
>
> $ mkdir d d/e d/e/f
> $ chmod a-w d
> $ rmdir -p d d/e/f
> rmdir: `d': Directory not empty
> rmdir: `d/e': Permission denied
> $ echo $?
> 0
>
> The exit status should be 1, not 0.
>
> I also noticed that EXIT_FAILURE might not equal 1, as POSIX does not
> require it. I recall that it's not 1 on traditional VMS, though I
> don't know if anyone uses coreutils on VMS or OpenVMS or whatever it's
> called these days. The patch below also addresses this issue, by
> adjusting the documentation slightly and introducing a new symbol
> EXIT_FAIL for when programs want to return 1 even if EXIT_FAILURE
> isn't 1.
Wow. That was a big one.
I've applied it and added a test for the rmdir bug.
Thank you!