Browse Source

[core] save errno around close() if fstat() fails

(should not happen, since file was just opened)
master
Glenn Strauss 12 months ago
parent
commit
b7370a6d46
  1. 2
      src/stat_cache.c

2
src/stat_cache.c

@ -1101,7 +1101,9 @@ int stat_cache_open_rdonly_fstat (const buffer *name, struct stat *st, int symli
if (0 == fstat(fd, st)) {
return fd;
} else {
const int errnum = errno;
close(fd);
errno = errnum;
}
}
return -1;

Loading…
Cancel
Save