On Fri, Jun 09, 2006 at 07:23:11PM -0500, [EMAIL PROTECTED] said:
> On Fri Jun  9 19:18:09 CDT 2006, [EMAIL PROTECTED] wrote:
> > On Fri, Jun 09, 2006 at 06:51:00PM -0500, [EMAIL PROTECTED] said:
> > > On Fri Jun  9 18:48:44 CDT 2006, [EMAIL PROTECTED] wrote:
> > > > > 
> > > > > what is the senerio you're thinking of where malloc could fail
> > > > > and you can recover?
> > > > 
> > > > 
> > > > Let's say you have a fossil like file server and you cannot malloc 
> > > > memory to
> > > > process new requests. Do you want to flush the data buffers back to the 
> > > > disk
> > > > before you die, you you want to die in some library without any 
> > > > flushing.
> > > 
> > > have you had a problem with fossil failing in this way?
> > 
> > IIRC fossil is not using libraries that call sysfatal. I said fossil like
> > file server, not fossil. Let's say that I want to write a fossil-like file
> > server. I cannot use lib9p, because it will call sysfatal and not give me
> > chance to flush the buffers to the disk.
> > 
> 
> sure you can.  sysfatal calls _sysfatal to do the deed.  redefine that to 
> call your
> fancy cleanup routine and you're golden.

And you think that's an example of writing good code? I thought we are
talking about a system with clean design that you don't need to use kludges in 
:)

        Lucho

Reply via email to