core: open_output_file: Prepare for M2-Planet.

* src/posix.c (open_output_file): Prepare for M2-Planet.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-24 21:32:39 +02:00
parent a48c4eabbd
commit 1fedea5db6
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 3 additions and 2 deletions

View File

@ -251,8 +251,9 @@ open_output_file (SCM x) /*:((arity . n)) */
SCM file_name = car (x);
x = cdr (x);
int mode = S_IRUSR | S_IWUSR;
if (TYPE (x) == TPAIR && TYPE (car (x)) == TNUMBER)
mode = VALUE (car (x));
if (TYPE (x) == TPAIR)
if (TYPE (car (x)) == TNUMBER)
mode = VALUE (car (x));
return make_number (mes_open (cell_bytes (STRING (file_name)), O_WRONLY | O_CREAT | O_TRUNC, mode));
}