Verified Commit be4520fb authored by Camil Staps's avatar Camil Staps 🚀

Cleanup files.h; fix C version of closeF

parent 70b8e92a
#define MAX_N_FILES 20
#define MAX_FILE_NAME_LENGTH 255
#ifdef MACH_O64
# define NEWLINE_CHAR '\r'
#else
......@@ -23,7 +20,7 @@ struct file {
static struct file clean_stdinout;
static struct file clean_stderr;
#define IO_error(s) do { EPRINTF("IO error: %s\n",s); goto IO_error_halt; } while (0)
#define IO_error(s) do { EPRINTF("IO error: %s\n",s); exit(1); } while (0)
static int stdio_open=0;
......
......@@ -95,8 +95,7 @@ instr_closeF t = foldl (flip append) t
, "} else if (f==&clean_stderr) {"
, "\tbsp[0]=1;"
, "} else {"
, "\tfclose(f->file_handle);"
, "\tbsp[0]=ferror(f->file_handle) ? 0 : 1;"
, "\tbsp[0]=fclose(f->file_handle) ? 0 : 1;"
, "\tfree(f);"
, "}"
, "}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment