diff options
author | Richard Basch <probe@mit.edu> | 1994-02-14 04:56:02 +0000 |
---|---|---|
committer | Richard Basch <probe@mit.edu> | 1994-02-14 04:56:02 +0000 |
commit | 58399cac5ca355dbdbd6ee5755351dc912eb731a (patch) | |
tree | ce1d20d2c06668353173fd2b77469cbc5d245813 /zwgc/port.c | |
parent | cfd65f639f90bcbba75b9f76367e797fbac9dd7f (diff) |
Check file descriptor, not errno, after fopen
Diffstat (limited to 'zwgc/port.c')
-rw-r--r-- | zwgc/port.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zwgc/port.c b/zwgc/port.c index c8b88f2..c0d48a0 100644 --- a/zwgc/port.c +++ b/zwgc/port.c @@ -507,7 +507,7 @@ void create_file_append_port(name, filename) oumask = umask(077); /* allow read/write for us only */ out = fopen(filename, "a"); (void) umask(oumask); - if (errno) { + if (out == NULL) { var_set_variable("error", perror_to_string(errno)); return; } @@ -523,7 +523,7 @@ void create_file_input_port(name, filename) errno = 0; in = fopen(filename, "r"); - if (errno) { + if (in == NULL) { var_set_variable("error", perror_to_string(errno)); return; } @@ -543,7 +543,7 @@ void create_file_output_port(name, filename) oumask = umask(077); /* allow read/write for us only */ out = fopen(filename, "w"); (void) umask(oumask); - if (errno) { + if (out == NULL) { var_set_variable("error", perror_to_string(errno)); return; } |