Fixed bug in fopen(3) where it didn't open correctly.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-01-18 12:40:31 +01:00
parent ba2cb5103a
commit 17d1b67a77
1 changed files with 1 additions and 1 deletions

View File

@ -184,7 +184,7 @@ FILE* fopen(const char* path, const char* mode)
default: errno = EINVAL; return 0;
}
}
int fd = open(path, fd, 0666);
int fd = open(path, omode | oflags, 0666);
if ( fd < 0 ) { return NULL; }
FILE* fp = fdopen(fd, mode);
if ( !fp ) { close(fd); return NULL; }