[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fwrite problems and bringing down MiNT



Hi,
      I was updating some code recently and accidentally ended up with a
negative number of 'bits' of information to write.  This had two results
when the program was run:

1.    (Without Memory Protection)  it hit the disk continuously wiping out
my minix partition (or was this that I switched off my Falcon while the file
was being updated - I don't think so).

2.    (With Memory Protection)  Gave a bus error and killed the program (as
it should).  Unfortunately it was a GEM program, and after it died nicely
and the Alert had been closed an error string on the console appeared which
stated that I must reboot (c'ant remember the exact words) and no matter
what key is pressed the message is just repeated.

Is this how fwrite should behave?  Wouldn't it be better to catch this and
return zero bits of information written.  Also don't know what happens if
fwrite is asked to write zero bits of information.

Any comments appreciated.  Andrew.