Skip to content

Commit

Permalink
scanbd/sane.c: make it clearer when no devices are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
mdengler committed Aug 25, 2014
1 parent 2d038db commit 19f276e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/scanbd/sane.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,19 @@ void get_sane_devices(void) {
slog(SLOG_WARN, "Can't get the sane device list");
}
const SANE_Device** dev = sane_device_list;
if (dev == NULL) {
slog(SLOG_DEBUG, "device list null");
if (dev == NULL || *dev == NULL) {
slog(SLOG_WARN, "device list null");
goto cleanup;
} else {
slog(SLOG_DEBUG, "got some devices");
}
while(*dev != NULL) {
slog(SLOG_DEBUG, "found device: %s %s %s %s",
(*dev)->name, (*dev)->vendor, (*dev)->model, (*dev)->type);
num_devices += 1;
dev++;
}
slog(SLOG_DEBUG, "got %i devices", num_devices);
if (pthread_cond_broadcast(&sane_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
Expand Down

0 comments on commit 19f276e

Please sign in to comment.