On Fri, Dec 19, 2008 at 12:52:12PM -0800, Maxim Sobolev wrote: > Should not it be better to implement this on the kernel side when the > device is closed abruptly? The state that is kept is not accumulated on any particular filedescriptor, it is associated with the physical state of the device.
Therefore, I think that kernel shall not be charged with cleanup, and userspace calls should deal with resetting device back to the pristine state. > > David E. O'Brien wrote: > >Author: obrien > >Date: Fri Dec 19 20:20:14 2008 > >New Revision: 186337 > >URL: http://svn.freebsd.org/changeset/base/186337 > > > >Log: > > burncd(8) doesn't handle signals and interrupting burncd during > > operation. > > For example, ^C (SIGINT) may leave the drive spinning and locked. > > This may also happen if you try to write a too-large image to a disc > > and burncd(8) exits with an I/O error. > > > > Add signal handling by doing a CDRIOCFLUSH ioctl to attempt to leave > > burner in a sane state when burning is interrupted with SIGHUP, SIGINT, > > SIGTERM, or in case an I/O error occurs during write. > > Note, that blanking will still continue after interrupt but it seems to > > finish correctly even after burncd(8) has quit. > > -Maxim
pgpwFdUxs7xwy.pgp
Description: PGP signature