Judah Jacobson <[email protected]> writes: > I think the below code might be slightly cleaner: > > x <- unsafeMMapFile `catch` $ \e -> do > size <- fileSize `fmap` getSymbolicLinkStatus f > if size == 0 > then return B.empty > else throwIO e > > That is, explicitly re-throw the caught exception, rather than calling > unsafeMMapFile again to get it implicitly re-thrown. The idea is that after performGC, there is a reasonable chance that the second call will actually succeed.
> Though, for this specific situation it probably doesn't make a big > difference which way you do it. It makes a difference, since this way it won't recover on out-of-fd's failure, unlike the proposed one -- this version will fail for good, which will basically kill darcs, there's no recovery elsewhere as far as I can tell. Yours, Petr. -- Peter Rockai | me()mornfall!net | prockai()redhat!com http://blog.mornfall.net | http://web.mornfall.net "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." -- Blair P. Houghton on the subject of C program indentation _______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
