diff options
author | Norbert Preining <preining@logic.at> | 2018-11-13 02:35:03 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2018-11-13 02:35:03 +0000 |
commit | 9a4198822984d6c431c83afb49399b6716e2a436 (patch) | |
tree | 64b042d27510de0dddf185e58342c42280c364bf /Build | |
parent | 9d432b0e3859202815eed839e4759d2ac7bb48cb (diff) |
kpathsea: tex-make.c: check return value from dup (from Andreas)
git-svn-id: svn://tug.org/texlive/trunk@49141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-make.c | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 6341326931e..ddfa0f799e4 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,7 @@ +2018-11-12 Andreas Scherer <https://ascherer.github.io> + + * tex-make.c (maketex): check return value from dup(2). + 2018-07-02 Karl Berry <karl@freefriends.org> * kpsewhich.c (lookup): warn that --all is ignored with bitmap fonts. diff --git a/Build/source/texk/kpathsea/tex-make.c b/Build/source/texk/kpathsea/tex-make.c index 95851fdd561..629857a3346 100644 --- a/Build/source/texk/kpathsea/tex-make.c +++ b/Build/source/texk/kpathsea/tex-make.c @@ -318,20 +318,32 @@ maketex (kpathsea kpse, kpse_file_format_type format, string* args) /* stdin -- the child will not receive input from this */ if (childin != 0) { close(0); - dup(childin); + if (dup(childin) != 0) { + perror("kpathsea: dup(2) failed for stdin"); + close(childin); + _exit(1); + } close(childin); } /* stdout -- the output of the child's action */ if (childout[1] != 1) { close(1); - dup(childout[1]); + if (dup(childout[1]) != 1) { + perror("kpathsea: dup(2) failed for stdout"); + close(childout[1]); + _exit(1); + } close(childout[1]); } /* stderr -- use /dev/null if we discard errors */ if (childerr != 2) { if (kpse->make_tex_discard_errors) { close(2); - dup(childerr); + if (dup(childerr) != 2) { + perror("kpathsea: dup(2) failed for stderr"); + close(childerr); + _exit(1); + } } close(childerr); } |