[sane-devel] Do not use exit() in backends

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Jan 17 18:33:42 GMT 2002


Hi,

Just to make sure all backend authors read the info covered in the gphoto2
thread:

Do not use exit() and similar functions (e.g. abort()) in backends. This will
effectively kill the frontend and stop the normal SANE way of doing things. So
no other scanners can be selected. Other scanners can't be closed properly
(because sane_close and sane_exit can't be called).

Just use return() to leave the current function and set an appropriate
SANE_Status code on error.

It's ok to use _exit() to leave a forked process.



More information about the sane-devel mailing list