Re: [Haifux] Telling the kernel business is closed (my weekly riddle)

2011-06-27 Thread Shachar Shemesh
On 27/06/11 00:29, Eli Billauer wrote: The brute-force way to do this is to check a device-global flag every invocation of read(), write(), and other relevant methods. Maybe also before returning a successful value. If the flag is set ( = problem detected) return some -EDROPDEAD, so that

Re: [Haifux] Telling the kernel business is closed (my weekly riddle)

2011-06-27 Thread Eli Billauer
Shachar Shemesh wrote: Nobody expects ENODEV on an already opened device. I'd go for EIO, myself. And so shall I. Thanks. As for how to handle the disaster event, my question was if there's a standard way to handle it. Checking if the device is OK all the time will make the code uglier.

Re: [Haifux] Telling the kernel business is closed (my weekly riddle)

2011-06-27 Thread Shachar Shemesh
On 27/06/11 11:31, Eli Billauer wrote: Checking if the device is OK all the time will make the code uglier. GIGO it is, then. Shachar -- Shachar Shemesh Lingnu Open Source Consulting Ltd. http://www.lingnu.com ___ Haifux mailing list

Re: [Haifux] Telling the kernel business is closed (my weekly riddle)

2011-06-27 Thread Oron Peled
On Monday, 27 בJune 2011 11:31:48 Eli Billauer wrote: Shachar Shemesh wrote: Nobody expects ENODEV on an already opened device. I'd go for EIO, myself. And so shall I. Thanks. ... And the truth is that I don't care about recovering from such an error. Another strategy is to throw