projects
/
osl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Return -E_OSL_NOENT if stat/open fails with errno == ENOENT.
[osl.git]
/
util.c
diff --git
a/util.c
b/util.c
index 7500c08b2a6f085f4acc4fc77efc985a4351d977..64d83c84f3292ffffa87af4f5129c891f4e3796e 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-88,7
+88,7
@@
int osl_open(const char *path, int flags, mode_t mode)
if (ret >= 0)
return ret;
if (ret >= 0)
return ret;
- return -E_OSL_OPEN;
+ return
errno == ENOENT? -E_OSL_NOENT :
-E_OSL_OPEN;
}
/**
}
/**
@@
-152,7
+152,7
@@
int mmap_full_file(const char *path, int open_mode, void **map,
return ret;
fd = ret;
if (fstat(fd, &file_status) < 0) {
return ret;
fd = ret;
if (fstat(fd, &file_status) < 0) {
- ret =
-E_OSL_F
STAT;
+ ret =
errno == ENOENT? -E_OSL_NOENT : -E_OSL_
STAT;
goto out;
}
*size = file_status.st_size;
goto out;
}
*size = file_status.st_size;