diff options
author | Mike Gran <spk121@yahoo.com> | 2019-02-09 16:59:38 -0800 |
---|---|---|
committer | Mike Gran <spk121@yahoo.com> | 2019-02-09 16:59:38 -0800 |
commit | 78468baa118d316050a27e43250966e52ffd3d54 (patch) | |
tree | 872501b436bf0e10b1bcd2f6ef2d7aab63cbfaef /libguile/filesys.c | |
parent | 1437b76777e576b3d000e2f80c5ecdb33a74ac33 (diff) | |
download | guile-78468baa118d316050a27e43250966e52ffd3d54.tar.gz |
Fix binary output on files created by mkstemp!
Some operating systems require a O_BINARY flag.
* libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag
* test-suite/tests/posix.test ("binary mode honored"): new test
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r-- | libguile/filesys.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c index e1aeeed1b..1a8dfa044 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2002, 2004, 2006, 2009-2018 +/* Copyright (C) 1996-2002, 2004, 2006, 2009-2019 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -1507,9 +1507,9 @@ SCM_DEFINE (scm_i_mkstemp, "mkstemp!", 1, 1, 0, /* mkostemp(2) only defines O_APPEND, O_SYNC, and O_CLOEXEC to be useful, as O_RDWR|O_CREAT|O_EXCL are implicitly added. It also notes that other flags may error on some systems, which turns - out to be the case. Of those flags, O_APPEND is the only one - of interest anyway, so limit to that flag. */ - open_flags &= O_APPEND; + out to be the case. Of those flags, O_APPEND and O_BINARY are + the only ones of interest anyway, so limit to those flags. */ + open_flags &= O_APPEND | O_BINARY; mode_bits = scm_i_mode_bits (mode); } |