summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
727d148)
A bug could cause an 'open' command to return no FD in which
case the initial value of '-1' would be used in the call to
close().
Reported-by: Coverity Scan (1395329 Improper use of negative value)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ if (fd < 0) {
+ return 0;
+ }
ret = close(fd);
if (ret < 0) {
PERROR("close error");
ret = close(fd);
if (ret < 0) {
PERROR("close error");