1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-28 16:00:22 +02:00

Fix mkstemp! with 1 argument

* libguile/filesys.c (scm_i_mkstemp): Add SCM_OPN to flags if mode
  argument not given.
This commit is contained in:
Andy Wingo 2016-07-16 15:45:37 +02:00
parent 0cf62c576d
commit 3f9ae30bd9

View file

@ -1482,7 +1482,7 @@ SCM_DEFINE (scm_i_mkstemp, "mkstemp!", 1, 1, 0,
flags; open_flags just adjoins flags to that set. */
open_flags = 0;
is_binary = 0;
mode_bits = SCM_RDNG | SCM_WRTNG;
mode_bits = SCM_OPN | SCM_RDNG | SCM_WRTNG;
}
else
{
@ -1502,10 +1502,8 @@ SCM_DEFINE (scm_i_mkstemp, "mkstemp!", 1, 1, 0,
port = scm_i_fdes_to_port (rv, mode_bits, tmpl);
if (is_binary)
{
/* Use the binary-friendly ISO-8859-1 encoding. */
scm_i_set_port_encoding_x (port, NULL);
}
/* Use the binary-friendly ISO-8859-1 encoding. */
scm_i_set_port_encoding_x (port, NULL);
return port;
}