VALUE posix

This commit is contained in:
Jan Nieuwenhuizen 2019-10-26 13:28:12 +02:00
parent d9d8c04c16
commit 20b861ac89
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 5 additions and 2 deletions

View File

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