summaryrefslogtreecommitdiff
path: root/sanei/sanei_thread.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-05-24 21:03:56 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-05-24 21:03:56 +0200
commit58912f68c2489bcee787599837447e0d64dfd61a (patch)
treedda50aadde35fe152da1a8d50769987ace0f1496 /sanei/sanei_thread.c
parentcfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff)
New upstream version 1.0.27upstream/1.0.27
Diffstat (limited to 'sanei/sanei_thread.c')
-rw-r--r--sanei/sanei_thread.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/sanei/sanei_thread.c b/sanei/sanei_thread.c
index 8db4a21..fcf52c1 100644
--- a/sanei/sanei_thread.c
+++ b/sanei/sanei_thread.c
@@ -71,9 +71,6 @@
#if !defined USE_PTHREAD && !defined HAVE_OS2_H && !defined __BEOS__
# include <sys/wait.h>
#endif
-#if defined USE_PTHREAD
-# include <pthread.h>
-#endif
#define BACKEND_NAME sanei_thread /**< name of this module for debugging */
@@ -135,9 +132,9 @@ sanei_thread_set_invalid( SANE_Pid *pid )
/* Return if PID is a valid PID or not. */
SANE_Bool
-sanei_thread_is_invalid( SANE_Pid pid )
+sanei_thread_is_valid( SANE_Pid pid )
{
- SANE_Bool rc = SANE_FALSE;
+ SANE_Bool rc = SANE_TRUE;
#ifdef WIN32
#ifdef WINPTHREAD_API
@@ -145,10 +142,10 @@ sanei_thread_is_invalid( SANE_Pid pid )
#else
if (pid.p == 0)
#endif
- rc = SANE_TRUE;
+ rc = SANE_FALSE;
#else
- if (pid == -1)
- rc = SANE_TRUE;
+ if (pid == (SANE_Pid) -1)
+ rc = SANE_FALSE;
#endif
return rc;
@@ -491,7 +488,7 @@ sanei_thread_waitpid( SANE_Pid pid, int *status )
#else
int ls;
#endif
- SANE_Pid result;
+ SANE_Pid result = pid;
int stat;
stat = 0;