[sane-devel] strange thread code?

m. allan noah anoah at pfeiffer.edu
Wed Dec 31 17:10:12 GMT 2003


i am converting the fujitsu backend to use sanei_thread instead of fork.
                                                                                
in reading the threading code, i found something that i dont understand,
and was hoping someone who knows a bit more could explain it to me:
                                                                                
in the function sanei_thread_waitpid(), the #ifdef PTHREAD section always
returns pid (around line 354). but farther down, in the #else section, the 
return val from the waitpid() call is returned (which is the pid on 
success, but 0 or -1 otherwise)

so if you are calling sanei_thread_waitpid() and there is an error, you 
might, or might not, get a negative return value?

am i not reading this code correctly?

allan

-- 
"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera







More information about the sane-devel mailing list