diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-02-27 18:33:48 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-02-27 18:33:48 -0800 |
commit | f94b59c49ee64695fd591a9eedf3ceea3737189a (patch) | |
tree | 10b2188e2a41e4d2cbf999410cde999f21577334 /stream.c | |
parent | 4496c575892fa34ae9aabf4e1c0f7da87f10c4c2 (diff) | |
download | txr-f94b59c49ee64695fd591a9eedf3ceea3737189a.tar.gz txr-f94b59c49ee64695fd591a9eedf3ceea3737189a.tar.bz2 txr-f94b59c49ee64695fd591a9eedf3ceea3737189a.zip |
open-fileno: errno usage.
* stream.c (open_fileno): clear errno to 0 before fdopen.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3148,7 +3148,7 @@ val open_file(val path, val mode_str) val open_fileno(val fd, val mode_str) { struct stdio_mode m; - FILE *f = w_fdopen(c_num(fd), c_str(normalize_mode(&m, mode_str))); + FILE *f = (errno = 0, w_fdopen(c_num(fd), c_str(normalize_mode(&m, mode_str)))); if (!f) uw_throwf(file_error_s, lit("error opening descriptor ~a: ~d/~s"), |