[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for m4-1.4.1
From: |
Andreas Schwab |
Subject: |
Re: patch for m4-1.4.1 |
Date: |
Fri, 06 Aug 2004 00:06:41 +0200 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
"Marion Hakanson" <address@hidden> writes:
> @@ -469,8 +470,11 @@
>
> errno = 0;
> while (length = fread (buffer, 1, COPY_BUFFER_SIZE, file),
> - length != 0)
> + length != 0) {
> + saved_errno = errno;
> output_text (buffer, length);
> + errno = saved_errno;
> + }
> if (errno)
> M4ERROR ((EXIT_FAILURE, errno, "ERROR: Reading inserted file"));
> }
This is not correct either, fread is allowed to set errno even if
successful. The only reliable way to get an error indicator is to use
ferror().
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Re: patch for m4-1.4.1,
Andreas Schwab <=