open-input-file creates non-blocking ports

This commit is contained in:
Alex Shinn 2010-12-11 22:37:41 -08:00
parent d29eea3780
commit c114357859

3
eval.c
View file

@ -916,6 +916,9 @@ sexp sexp_open_input_file_op (sexp ctx sexp_api_params(self, n), sexp path) {
in = fopen(sexp_string_data(path), "r");
if (! in)
return sexp_user_exception(ctx, self, "couldn't open input file", path);
#if SEXP_USE_GREEN_THREADS
fcntl(fileno(in), F_SETFL, O_NONBLOCK);
#endif
return sexp_make_input_port(ctx, in, path);
}