Bypass fsync(NULL) (crashes miniperl compiled with DEC C 5.2)
Craig A. Berry [Wed, 11 Aug 1999 14:31:11 +0000 (09:31 -0500)]
Sender: owner-perl5-porters@perl.org
To: vmsperl@perl.org, perl5-porters@perl.org, sarathy@activestate.com,
        bailey@newman.upenn.edu
Subject: [PATCH 5.005_60] vms.c my_flush patch to circumvent fileno
problem
Message-Id: <4.2.0.58.19990811141007.00b8f8a0@mmtnt11.metamor.com>

p4raw-id: //depot/cfgperl@3959

vms/vms.c

index 0845ff9..bf2726f 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -3576,7 +3576,7 @@ int
 my_flush(FILE *fp)
 {
     int res;
-    if ((res = fflush(fp)) == 0) {
+    if ((res = fflush(fp)) == 0 && fp) {
 #ifdef VMS_DO_SOCKETS
        Stat_t s;
        if (Fstat(fileno(fp), &s) == 0 && !S_ISSOCK(s.st_mode))