strcpy (perlprefix,"..");
}
+int
+djgpp_fflush (FILE *fp)
+{
+ int res;
+
+ if ((res = fflush(fp)) == 0 && fp) {
+ Stat_t s;
+ if (Fstat(fileno(fp), &s) == 0 && !S_ISSOCK(s.st_mode))
+ res = fsync(fileno(fp));
+ }
+/*
+ * If the flush succeeded but set end-of-file, we need to clear
+ * the error because our caller may check ferror(). BTW, this
+ * probably means we just flushed an empty file.
+ */
+ if (res == 0 && fp && ferror(fp) == EOF) clearerr(fp);
+
+ return res;
+}
#define fwrite1 fwrite
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
-#define Fflush(fp) fflush(fp)
+#ifdef DJGPP
+# define Fflush(fp) djgpp_fflush(fp)
+#else
+# define Fflush(fp) fflush(fp)
+#endif
#define Mkdir(path,mode) mkdir((path),(mode))
#ifndef WIN32
{
local *F;
for (1..2) {
- open(F, "echo #foo|") or print "not ";
+ open(F, "echo \\#foo|") or print "not ";
print <F>;
close F;
}
ok;
for (1..2) {
- open(F, "-|", "echo #foo") or print "not ";
+ open(F, "-|", "echo \\#foo") or print "not ";
print <F>;
close F;
}