From: Alain Magloire Message-Id: <199904082241.SAA27805@mccoy2.ECE.McGill.CA> Subject: Re: fflush question To: djgpp-workers AT delorie DOT com Date: Thu, 8 Apr 1999 18:41:48 -0400 (EDT) In-Reply-To: <370D1E26.F953128@cartsys.com> from "Nate Eldredge" at Apr 8, 99 02:22:46 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Bonjour > Here's some weird results. I used the same test program, slightly > modified: > > test1.c: no fsync > > #include > > main() > { .... > else > printf("i=%d\n"); ^^^^^^^^^^^^^^^^^^^^^ > } an argument is missing in your test. > test2.c: with fsync > > #include > #include > main() > { ... > fscanf(b, "%d", &i); > if (fscanf(b, "%d", &i) < 1) Two fscanf () ?? > printf("fscanf failed\n"); > else > printf("i=%d\n"); > } > > .... > So do these systems have serious bugs in scanf, or is there a subtle bug > in the test that I missed? Yes. In your second test your doing 2 fscanf(), and the printf() is missing an argument. I run this On Solaris, QNX, SunOS with no problems .i.e no need for fsync(). -- au revoir, alain ---- Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!