On Fri, Feb 23, 2018 at 10:00:24PM +0100, René Scharfe wrote:
> How about adding a stealthy close_no_errno(), or do something like the
> following to get shorter and more readable code? (We could also keep
> a single close() call, but would then set errno even on success.)
> [...]
> @@ -391,7 +39
Am 23.02.2018 um 23:17 schrieb Junio C Hamano:
> René Scharfe writes:
>
>> +#define IGNORE_ERROR(expr) do { int e_ = errno; expr; errno = e_; } while
>> (0)
>
> The macro certainly is a cute idea, but ...
>
>> @@ -391,7 +393,7 @@ ssize_t strbuf_read(struct strbuf *sb, int fd, size_t
>> hint)
René Scharfe writes:
> +#define IGNORE_ERROR(expr) do { int e_ = errno; expr; errno = e_; } while (0)
The macro certainly is a cute idea, but ...
> @@ -391,7 +393,7 @@ ssize_t strbuf_read(struct strbuf *sb, int fd, size_t
> hint)
>
> if (got < 0) {
> if (o
Am 23.02.2018 um 08:00 schrieb Jeff King:
> On Fri, Feb 23, 2018 at 01:49:52AM -0500, Jeff King wrote:
> Subject: [PATCH] strbuf_read_file(): preserve errno across close() call
>
> If we encounter a read error, the user may want to report it
> by looking at errno. However, our close() call may clo
4 matches
Mail list logo