[8345] in Athena Bugs
7.3P: pickup, collect don't check fclose status
daemon@ATHENA.MIT.EDU (brlewis@Athena.MIT.EDU)
Mon Oct 7 10:52:22 1991
From: brlewis@Athena.MIT.EDU
Date: Mon, 7 Oct 91 10:53:12 -0400
To: bugs@Athena.MIT.EDU
Please apply the following patch to
/source/athena/athena.bin/turnin/lib/fx_retrieve_file.c
*** fx_retrieve_file.c~ Mon Oct 7 10:47:23 1991
--- fx_retrieve_file.c Mon Oct 7 10:50:22 1991
***************
*** 38,44 ****
if ((fp = fopen(filename, "w")) == NULL) return((long) errno);
code = fx_retrieve(fxp, p, fp);
! (void) fclose(fp);
/* If there's an error, don't leave a zero-length file. */
if (code) {
--- 38,44 ----
if ((fp = fopen(filename, "w")) == NULL) return((long) errno);
code = fx_retrieve(fxp, p, fp);
! if (fclose(fp) == EOF && !code) code = (long) errno;
/* If there's an error, don't leave a zero-length file. */
if (code) {