summaryrefslogtreecommitdiff
path: root/backend/bh.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-16 10:20:08 +0100
commit778ebf8ee9cb22ea5727844333bcd5a6ee6bc0de (patch)
treea754e785b286ed82b45fe4e50b980714ad80e0a7 /backend/bh.c
parent7d8aac1f3634dc58785bec7acf097dd6bac8c394 (diff)
parent32cb765f681299af226ca0520993cbe47ba5ecd0 (diff)
Merge branch 'release/debian/1.2.1-1'debian/1.2.1-1
Diffstat (limited to 'backend/bh.c')
-rw-r--r--backend/bh.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/backend/bh.c b/backend/bh.c
index 0f2e70e..31ebe93 100644
--- a/backend/bh.c
+++ b/backend/bh.c
@@ -1895,6 +1895,11 @@ start_scan (BH_Scanner *s)
{
DBG(1, "sane_start: error opening barfile `%s'\n",
s->barfname);
+ if (fd !=-1)
+ {
+ close(fd);
+ unlink(s->barfname);
+ }
status = SANE_STATUS_IO_ERROR;
}
}
@@ -1979,7 +1984,7 @@ sense_handler (int scsi_fd, u_char *result, void *arg)
SANE_Status status = SANE_STATUS_INVAL;
SANE_Char print_sense[(16 * 3) + 1];
- scsi_fd = scsi_fd; /* get rid of compiler warning */
+ (void) scsi_fd; /* get rid of compiler warning */
ErrorCode = result[0] & 0x7F;
ValidData = (result[0] & 0x80) != 0;
sense = result[2] & 0x0f; /* Key */
@@ -3145,7 +3150,7 @@ sane_init (SANE_Int *version_code, SANE_Auth_Callback authorize)
char devnam[PATH_MAX] = "/dev/scanner";
FILE *fp;
- authorize = authorize; /* get rid of compiler warning */
+ (void) authorize; /* get rid of compiler warning */
DBG_INIT();
DBG(3, "sane_init called\n");
@@ -3233,7 +3238,7 @@ sane_get_devices (const SANE_Device ***device_list, SANE_Bool local)
int i;
DBG(3, "sane_get_devices called\n");
- local = local; /* get rid of compiler warning */
+ (void) local; /* get rid of compiler warning */
if (devlist)
free (devlist);
devlist = malloc ((num_devices + 1) * sizeof (devlist[0]));
@@ -3806,7 +3811,7 @@ sane_set_io_mode (SANE_Handle handle, SANE_Bool non_blocking)
return SANE_STATUS_GOOD;
#else
- handle = handle; /* get rid of compiler warning */
+ (void) handle; /* get rid of compiler warning */
return (non_blocking == 1) ? SANE_STATUS_UNSUPPORTED : SANE_STATUS_GOOD;
#endif
}
@@ -3828,7 +3833,7 @@ sane_get_select_fd (SANE_Handle handle, SANE_Int *fd)
return SANE_STATUS_GOOD;
#else
- handle = handle; fd = fd; /* get rid of compiler warning */
+ (void) handle; (void) fd; /* get rid of compiler warning */
return SANE_STATUS_UNSUPPORTED;
#endif
}