unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").

To comply with Python semantics.
This commit is contained in:
Ari Suutari 2015-06-18 16:05:44 +03:00 committed by Paul Sokolovsky
parent 60ccb41fac
commit 63b9e598a3

View File

@ -161,7 +161,7 @@ STATIC mp_obj_t fdfile_open(mp_obj_t type_in, mp_arg_val_t *args) {
mode |= O_WRONLY | O_CREAT | O_TRUNC; mode |= O_WRONLY | O_CREAT | O_TRUNC;
break; break;
case 'a': case 'a':
mode |= O_APPEND; mode |= O_WRONLY | O_CREAT | O_APPEND;
break; break;
case '+': case '+':
mode |= O_RDWR; mode |= O_RDWR;