diff options
| author | Stephane Chazelas <stephane.chazelas@gmail.com> | 2018-03-18 16:49:42 -0700 |
|---|---|---|
| committer | Barton E. Schaefer <schaefer@zsh.org> | 2018-03-18 16:49:42 -0700 |
| commit | d2350a1e8027e9550996464739885f5ec468bd83 (patch) | |
| tree | 005357eaa5df8be0b5e374e13753c853c16d5d7e | |
| parent | 42465: Pass up error status from readoutput(). (diff) | |
| download | zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar.gz zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar.bz2 zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar.lz zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar.xz zsh-d2350a1e8027e9550996464739885f5ec468bd83.tar.zst zsh-d2350a1e8027e9550996464739885f5ec468bd83.zip | |
42469: necessary repairs to 42465 found by "make check"
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | Src/Modules/mapfile.c | 3 | ||||
| -rw-r--r-- | Src/exec.c | 4 |
3 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,7 @@ +2018-03-18 Barton E. Schaefer <schaefer@brasslantern.com> + + * Stephane: 42469: Src/exec.c, Src/Modules/mapfile.c: fix 42465 + 2018-03-15 Peter Stephenson <p.stephenson@samsung.com> * Stephane: 42465: Src/exec.c, Src/Modules/mapfile.c: pass error diff --git a/Src/Modules/mapfile.c b/Src/Modules/mapfile.c index 771e5b5fc..7a903418f 100644 --- a/Src/Modules/mapfile.c +++ b/Src/Modules/mapfile.c @@ -197,9 +197,8 @@ get_contents(char *fname) val = NULL; if ((fd = open(fname, O_RDONLY | O_NOCTTY)) >= 0) { LinkList ll; - int readerror; - if ((ll = readoutput(fd, 1, &readerror))) + if ((ll = readoutput(fd, 1, 0))) val = peekfirst(ll); } #endif /* USE_MMAP */ diff --git a/Src/exec.c b/Src/exec.c index ce8cf8c55..35b0bb191 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4599,8 +4599,8 @@ readoutput(int in, int qt, int *readerror) } *ptr++ = c; } - if (readerror && ferror(fin)) - *readerror = errno; + if (readerror) + *readerror = ferror(fin) ? errno : 0; fclose(fin); while (cnt && ptr[-1] == '\n') ptr--, cnt--; |
