diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:45:34 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 18:45:34 +0200 |
commit | 2b3e02411ecc09e7d41741b5587655c9b2f955b7 (patch) | |
tree | d839746371ecb8ed64ac81d2e37c11fcd25a00ac /frontend | |
parent | 787fb1d54ec9ee5fb941ae897fb201feb9cb2fd1 (diff) | |
parent | ad38bc6ecb80ddeb562841b33258dd53659b1da6 (diff) |
Update upstream source from tag 'upstream/1.0.31'
Update to upstream version '1.0.31'
with Debian dir aa7a39fe56343f5e164eec83783f4c923a394865
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/Makefile.am | 1 | ||||
-rw-r--r-- | frontend/saned.c | 10 | ||||
-rw-r--r-- | frontend/scanimage.c | 22 |
3 files changed, 22 insertions, 11 deletions
diff --git a/frontend/Makefile.am b/frontend/Makefile.am index 525953f..d27acf2 100644 --- a/frontend/Makefile.am +++ b/frontend/Makefile.am @@ -21,6 +21,7 @@ scanimage_LDADD = ../backend/libsane.la ../sanei/libsanei.la ../lib/liblib.la \ $(PNG_LIBS) $(JPEG_LIBS) saned_SOURCES = saned.c +saned_CPPFLAGS = $(AM_CPPFLAGS) $(AVAHI_CFLAGS) saned_LDADD = ../backend/libsane.la ../sanei/libsanei.la ../lib/liblib.la \ $(SYSLOG_LIBS) $(SYSTEMD_LIBS) $(AVAHI_LIBS) diff --git a/frontend/saned.c b/frontend/saned.c index 6c3c40d..0317542 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -155,7 +155,7 @@ poll (struct pollfd *ufds, unsigned int nfds, int timeout) } #endif /* HAVE_SYS_POLL_H && HAVE_POLL */ -#ifdef WITH_AVAHI +#if WITH_AVAHI # include <avahi-client/client.h> # include <avahi-client/publish.h> @@ -2286,7 +2286,7 @@ wait_child (pid_t pid, int *status, int options) if (ret <= 0) return ret; -#ifdef WITH_AVAHI +#if WITH_AVAHI if ((avahi_pid > 0) && (ret == avahi_pid)) { avahi_pid = -1; @@ -2428,7 +2428,7 @@ bail_out (int error) { DBG (DBG_ERR, "%sbailing out, waiting for children...\n", (error) ? "FATAL ERROR; " : ""); -#ifdef WITH_AVAHI +#if WITH_AVAHI if (avahi_pid > 0) kill (avahi_pid, SIGTERM); #endif /* WITH_AVAHI */ @@ -2457,7 +2457,7 @@ sig_int_term_handler (int signum) } -#ifdef WITH_AVAHI +#if WITH_AVAHI static void saned_avahi (struct pollfd *fds, int nfds); @@ -3221,7 +3221,7 @@ run_standalone (char *user) if (user) runas_user(user); -#ifdef WITH_AVAHI +#if WITH_AVAHI DBG (DBG_INFO, "run_standalone: spawning Avahi process\n"); saned_avahi (fds, nfds); diff --git a/frontend/scanimage.c b/frontend/scanimage.c index ae65ebf..3902092 100644 --- a/frontend/scanimage.c +++ b/frontend/scanimage.c @@ -369,13 +369,13 @@ print_option (SANE_Device * device, int opt_num, const SANE_Option_Descriptor *o } /* if both of these are set, option is invalid */ - if(opt->cap & SANE_CAP_SOFT_SELECT && opt->cap & SANE_CAP_HARD_SELECT){ + if((opt->cap & SANE_CAP_SOFT_SELECT) && (opt->cap & SANE_CAP_HARD_SELECT)){ fprintf (stderr, "%s: invalid option caps, SS+HS\n", prog_name); return; } /* invalid to select but not detect */ - if(opt->cap & SANE_CAP_SOFT_SELECT && !(opt->cap & SANE_CAP_SOFT_DETECT)){ + if((opt->cap & SANE_CAP_SOFT_SELECT) && !(opt->cap & SANE_CAP_SOFT_DETECT)){ fprintf (stderr, "%s: invalid option caps, SS!SD\n", prog_name); return; } @@ -609,7 +609,7 @@ print_option (SANE_Device * device, int opt_num, const SANE_Option_Descriptor *o else if(opt->cap & SANE_CAP_HARD_SELECT) fputs (" [hardware]", stdout); - else if(!(opt->cap & SANE_CAP_SOFT_SELECT) && opt->cap & SANE_CAP_SOFT_DETECT) + else if(!(opt->cap & SANE_CAP_SOFT_SELECT) && (opt->cap & SANE_CAP_SOFT_DETECT)) fputs (" [read-only]", stdout); fputs ("\n ", stdout); @@ -987,7 +987,15 @@ set_option (SANE_Handle device, int optnum, void *valuep) SANE_Int info = 0; opt = sane_get_option_descriptor (device, optnum); - if (opt && (!SANE_OPTION_IS_ACTIVE (opt->cap))) + if (!opt) + { + if (verbose > 0) + fprintf (stderr, "%s: ignored request to set invalid option %d\n", + prog_name, optnum); + return; + } + + if (!SANE_OPTION_IS_ACTIVE (opt->cap)) { if (verbose > 0) fprintf (stderr, "%s: ignored request to set inactive option %s\n", @@ -1229,7 +1237,9 @@ write_png_header (SANE_Frame format, int width, int height, int depth, int dpi, #ifdef HAVE_LIBJPEG static void -write_jpeg_header (SANE_Frame format, int width, int height, int dpi, FILE *ofp, struct jpeg_compress_struct *cinfo, struct jpeg_error_mgr *jerr) +write_jpeg_header (SANE_Frame format, int width, int height, int dpi, FILE *ofp, + struct jpeg_compress_struct *cinfo, + struct jpeg_error_mgr *jerr) { cinfo->err = jpeg_std_error(jerr); jpeg_create_compress(cinfo); @@ -2599,7 +2609,7 @@ List of available devices:", prog_name); ofp = fopen(output_file, "w"); if (ofp == NULL) { - fprintf(stderr, "%s: could not open input file '%s', " + fprintf(stderr, "%s: could not open output file '%s', " "exiting\n", prog_name, output_file); scanimage_exit(1); } |