mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix fopen(filename, "w") not creating files.
This commit is contained in:
parent
df67725221
commit
3a35139e6c
1 changed files with 1 additions and 2 deletions
|
@ -185,9 +185,8 @@ FILE* fopen(const char* path, const char* mode)
|
||||||
{
|
{
|
||||||
case 'r': omode = O_RDONLY; break;
|
case 'r': omode = O_RDONLY; break;
|
||||||
case 'a': oflags |= O_APPEND; /* fall-through */
|
case 'a': oflags |= O_APPEND; /* fall-through */
|
||||||
case 'w': omode = O_WRONLY; break;
|
case 'w': omode = O_WRONLY; oflags |= O_CREAT | O_TRUNC; break;
|
||||||
case '+':
|
case '+':
|
||||||
if ( omode == O_WRONLY ) { oflags |= O_CREAT | O_TRUNC; }
|
|
||||||
omode = O_RDWR;
|
omode = O_RDWR;
|
||||||
break;
|
break;
|
||||||
case 'b': break;
|
case 'b': break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue