From: Timothy L. <ti...@wo...> - 2000-12-27 08:19:18
|
David Paschal wrote: > Would it make more sense to fork or not fork by default > (changeable by a command-line option)? > Umm... if you intend ptal-printd to be run by regular users, default to *not* fork. Saves typing an extra flag. ;-) Add an option like -daemon to enable forking of child process, I suppose. David Paschal wrote: > Part of the problem was that it wasn't immediately obvious what the most > appropriate recovery was for each of the possible errors. I suppose it's > OK to exit if an error occurs during startup, for example, failure to create > the pipe. > Yes, I think you can exit upon failing to create the pipe. As for the other run-time conditions you mentioned, here are my suggestions: * Failure to open the pipe / failure on select () ---- Just discard the data * Failure to open peripheral ---- can ieee12844pp.o force ieee12844.o to re-scan for new peripherals??? If not, I'd say discard the data * Failure to write data to the peripheral ---- maybe a retry threshold, after which data are discarded? One more thing, about the ieee12844.c and ieee12844pp.c: the static variable *debug* should be initialized to 0. Most end-users probably don't want to see messages popping up on their consoles..... <grin> Timothy |