summaryrefslogtreecommitdiff
path: root/backend/test.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 /backend/test.c
parentcfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff)
New upstream version 1.0.27upstream/1.0.27
Diffstat (limited to 'backend/test.c')
-rw-r--r--backend/test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/test.c b/backend/test.c
index d5b7365..2ca5b3b 100644
--- a/backend/test.c
+++ b/backend/test.c
@@ -1355,7 +1355,7 @@ finish_pass (Test_Device * test_device)
DBG (2, "finish_pass: pipe closed\n");
test_device->pipe = -1;
}
- if (test_device->reader_pid != -1)
+ if (sanei_thread_is_valid (test_device->reader_pid))
{
int status;
SANE_Pid pid;
@@ -1364,7 +1364,7 @@ finish_pass (Test_Device * test_device)
(long) test_device->reader_pid);
sanei_thread_kill (test_device->reader_pid);
pid = sanei_thread_waitpid (test_device->reader_pid, &status);
- if (pid == -1)
+ if (!sanei_thread_is_valid (pid))
{
DBG (1,
"finish_pass: sanei_thread_waitpid failed, already terminated? (%s)\n",
@@ -2568,7 +2568,7 @@ sane_start (SANE_Handle handle)
test_device->reader_pid =
sanei_thread_begin (reader_task, (void *) test_device);
- if (test_device->reader_pid == -1)
+ if (!sanei_thread_is_valid (test_device->reader_pid))
{
DBG (1, "sane_start: sanei_thread_begin failed (%s)\n",
strerror (errno));