[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure
From: |
Jim Meyering |
Subject: |
Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure |
Date: |
Thu, 14 Aug 2008 14:33:38 +0200 |
Eric Blake <address@hidden> wrote:
> According to Jim Meyering on 8/14/2008 6:12 AM:
> |> | + error (0, errno, _("cannot create temporary file in %s"),
> |> | + quote (temp_dir));
> |> | + exit (SORT_FAILURE);
> |> | + }
> |>
> |> Why not the single statement error (SORT_FAILURE, errno, _(...))?
> |
> | Without the file or directory name, it's harder
> | to determine which file system is in question.
>
> But that doesn't answer my question. error(SORT_FAILURE,...) will call
> exit(SORT_FAILURE) on your behalf, since SORT_FAILURE is non-zero. In
> other words, why not let error() do the exiting, for less code on your side?
Ahh... I misinterpreted the "))" as the suggested change,
and didn't notice the s/0/SORT_FAILURE/ part.
There, you're absolutely right.
I blindly copied those two statements from the definition of die.
In this context, there's no need for the explicit exit.
Thanks!
- [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Jim Meyering, 2008/08/13
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Andreas Schwab, 2008/08/13
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Jim Meyering, 2008/08/14
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Eric Blake, 2008/08/14
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Jim Meyering, 2008/08/14
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure, Eric Blake, 2008/08/14
- Re: [PATCH] mktemp, sort, tac: don't use undefined after mkstemp failure,
Jim Meyering <=