Correct the test of the return value from sanei_thread_begin

merge-requests/1/head
Mattias Ellert 2007-11-16 08:04:02 +00:00
rodzic eb850185bb
commit abd402ad51
11 zmienionych plików z 25 dodań i 15 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2007-11-16 Mattias Ellert <mattias.ellert@tsl.uu.se>
* backend/artec_eplus48u.c, backend/coolscan.c, backend/mustek.c,
backend/pie.c, backend/plustek.c, backend/plustek_pp.c,
backend/snapscan.c, backend/test.c, backend/u12.c, backend/umax.c:
Correct the test of the return value from sanei_thread_begin.
2007-11-12 Julien Blache <jb@jblache.org>
* doc/descriptions-external/epkowa.desc: Update epkowa.desc for
iScan! 2.10.0. Patch provided by Olaf Meeuwissen.

Wyświetl plik

@ -4285,7 +4285,7 @@ sane_start (SANE_Handle handle)
s->reader_pipe = fds[1];
s->reader_pid = sanei_thread_begin (reader_process, s);
cancelRead = SANE_FALSE;
if (s->reader_pid < 0)
if (s->reader_pid == -1)
{
s->scanning = SANE_FALSE;
XDBG ((2, "sane_start: sanei_thread_begin failed (%s)\n", strerror (errno)));

Wyświetl plik

@ -4090,7 +4090,7 @@ sane_start (SANE_Handle handle)
scanner->pipe = fds[0];
scanner->reader_fds = fds[1];
scanner->reader_pid = sanei_thread_begin( reader_process, (void*)scanner );
if (scanner->reader_pid < 0)
if (scanner->reader_pid == -1)
{
DBG (1, "sane_start: sanei_thread_begin failed (%s)\n",
strerror (errno));

Wyświetl plik

@ -6558,7 +6558,7 @@ sane_start (SANE_Handle handle)
/* create reader routine as new process or thread */
s->reader_pid = sanei_thread_begin (reader_process, (void *) s);
if (s->reader_pid < 0)
if (s->reader_pid == -1)
{
DBG (1, "sane_start: sanei_thread_begin failed (%s)\n",
strerror (errno));

Wyświetl plik

@ -3704,7 +3704,7 @@ sane_start (SANE_Handle handle)
scanner->reader_fds = fds[1];
scanner->reader_pid = sanei_thread_begin( reader_process, (void*)scanner );
if (scanner->reader_pid < 0)
if (scanner->reader_pid == -1)
{
DBG (1, "sane_start: sanei_thread_begin failed (%s)\n",
strerror (errno));

Wyświetl plik

@ -2605,9 +2605,9 @@ sane_start( SANE_Handle handle )
cancelRead = SANE_FALSE;
if( s->reader_pid < 0 ) {
if( s->reader_pid == -1 ) {
DBG( _DBG_ERROR, "ERROR: could not start reader task\n" );
s->scanning = SANE_FALSE;
s->scanning = SANE_FALSE;
usbDev_close( dev );
return SANE_STATUS_IO_ERROR;
}

Wyświetl plik

@ -2014,9 +2014,9 @@ SANE_Status sane_start( SANE_Handle handle )
s->w_pipe = fds[1];
s->reader_pid = sanei_thread_begin( reader_process, s );
if( s->reader_pid < 0 ) {
if( s->reader_pid == -1 ) {
DBG( _DBG_ERROR, "ERROR: could not create child process\n" );
s->scanning = SANE_FALSE;
s->scanning = SANE_FALSE;
s->hw->close( s->hw );
return SANE_STATUS_IO_ERROR;
}

Wyświetl plik

@ -1287,7 +1287,7 @@ static SANE_Status start_reader (SnapScan_Scanner *pss)
cancelRead = SANE_FALSE;
if (pss->child < 0)
if (pss->child == -1)
{
/* we'll have to read in blocking mode */
DBG (DL_MAJOR_ERROR,
@ -1934,7 +1934,10 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
/*
* $Log$
* Revision 1.68 2006/09/03 10:00:11 oliver-guest
* Revision 1.69 2007/11/16 08:04:02 ellert-guest
* Correct the test of the return value from sanei_thread_begin
*
* Revision 1.68 2006-09-03 10:00:11 oliver-guest
* Bugfix for firmware download by Paul Smedley
*
* Revision 1.67 2006/01/10 19:32:16 oliver-guest

Wyświetl plik

@ -2542,7 +2542,7 @@ sane_start (SANE_Handle handle)
test_device->reader_pid =
sanei_thread_begin (reader_task, (void *) test_device);
if (test_device->reader_pid < 0)
if (test_device->reader_pid == -1)
{
DBG (1, "sane_start: sanei_thread_begin failed (%s)\n",
strerror (errno));

Wyświetl plik

@ -1731,9 +1731,9 @@ SANE_Status sane_start( SANE_Handle handle )
cancelRead = SANE_FALSE;
if( s->reader_pid < 0 ) {
if( s->reader_pid == -1 ) {
DBG( _DBG_ERROR, "ERROR: could not start reader task\n" );
s->scanning = SANE_FALSE;
s->scanning = SANE_FALSE;
u12if_close( dev );
return SANE_STATUS_IO_ERROR;
}

Wyświetl plik

@ -7990,13 +7990,13 @@ SANE_Status sane_start(SANE_Handle handle)
/* start reader_process, deponds on OS if fork() or threads are used */
scanner->reader_pid = sanei_thread_begin(reader_process, (void *) scanner);
if (scanner->reader_pid < 0)
if (scanner->reader_pid == -1)
{
DBG(DBG_error, "ERROR: sanei_thread_begin failed (%s)\n", strerror(errno));
scanner->scanning = SANE_FALSE;
umax_give_scanner(scanner->device); /* reposition and release scanner */
umax_scsi_close(scanner->device);
return SANE_STATUS_NO_MEM; /* any other reason than no memory possible ? */
return SANE_STATUS_NO_MEM; /* any other reason than no memory possible ? */
}
if (sanei_thread_is_forked())