diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2022-02-22 20:12:28 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2022-02-22 20:12:28 +0200 |
commit | 80de2f7c9bc519fb820033a530e1657977117a33 (patch) | |
tree | e0b8b01efe8040cdb7b5039d17aa93a85bc0b442 /io.c | |
parent | 938afb4d7acb9974d5789dfe4e322c0ccce0541e (diff) | |
download | egawk-80de2f7c9bc519fb820033a530e1657977117a33.tar.gz egawk-80de2f7c9bc519fb820033a530e1657977117a33.tar.bz2 egawk-80de2f7c9bc519fb820033a530e1657977117a33.zip |
Fix resource links found by Coverity.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -628,8 +628,8 @@ remap_std_file(int oldfd) if (newfd >= 0) { /* if oldfd is open, dup2() will close oldfd for us first. */ ret = dup2(newfd, oldfd); - if (ret == 0) - close(newfd); + // close unconditionally, calling code assumes it + close(newfd); } else ret = 0; |