mirror of
https://github.com/corda/corda.git
synced 2025-02-27 19:46:38 +00:00
fix interpretation of stat() return value in System::identify()
This commit is contained in:
parent
59d26362fa
commit
dc9ae3d269
@ -570,7 +570,7 @@ class MySystem: public System {
|
|||||||
virtual FileType identify(const char* name) {
|
virtual FileType identify(const char* name) {
|
||||||
struct stat s;
|
struct stat s;
|
||||||
int r = stat(name, &s);
|
int r = stat(name, &s);
|
||||||
if (r) {
|
if (r == 0) {
|
||||||
if (S_ISREG(s.st_mode)) {
|
if (S_ISREG(s.st_mode)) {
|
||||||
return File;
|
return File;
|
||||||
} else if (S_ISDIR(s.st_mode)) {
|
} else if (S_ISDIR(s.st_mode)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user