forked from OSchip/llvm-project
parent
1de35e719f
commit
a8acef6c68
|
@ -1065,7 +1065,7 @@ std::error_code identify_magic(const Twine &Path, file_magic &Result) {
|
|||
|
||||
char Buffer[32];
|
||||
int Length = read(FD, Buffer, sizeof(Buffer));
|
||||
if (Length < 0)
|
||||
if (close(FD) != 0 || Length < 0)
|
||||
return std::error_code(errno, std::generic_category());
|
||||
|
||||
Result = identify_magic(StringRef(Buffer, Length));
|
||||
|
|
Loading…
Reference in New Issue