opendir() did not correctly set "errno" if sys_open_dir() failed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4297 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,8 +30,10 @@ opendir(const char *path)
|
||||
DIR *dir;
|
||||
|
||||
int fd = sys_open_dir(path);
|
||||
if (fd < 0)
|
||||
if (fd < 0) {
|
||||
errno = fd;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* allocate the memory for the DIR structure */
|
||||
if ((dir = (DIR *)malloc(sizeof(DIR) + BUFFER_SIZE)) == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user