diff options
| author | Agney Lopes Roth Ferraz <agney@debian.org> | 2006-06-09 08:51:12 -0300 | 
|---|---|---|
| committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:35 -0500 | 
| commit | 18820242e374421ebd6d504a20d11f310b2ac023 (patch) | |
| tree | 22f0f468866e0405e11dd71b1ccedc2f7d7eb5c7 /arch/common | |
| parent | 5463b95dd354d4aff1c626b756d5586750f24d4d (diff) | |
Import Debian changes 0.4-3
hardinfo (0.4-3) unstable; urgency=low
  * Updated project's homepage, old is unreachable. (Closes: #370797)
  * upated printers.h (Closes: #370363)
Diffstat (limited to 'arch/common')
| -rw-r--r-- | arch/common/printers.h | 26 | 
1 files changed, 20 insertions, 6 deletions
| diff --git a/arch/common/printers.h b/arch/common/printers.h index 8632ea18..01beb5dd 100644 --- a/arch/common/printers.h +++ b/arch/common/printers.h @@ -19,18 +19,30 @@  void  scan_printers(void)  { -    GModule *cups; +    static GModule *cups = NULL;      static int (*cupsGetPrinters) (char ***printers) = NULL;      static char *(*cupsGetDefault) (void) = NULL; +    static char *libcups[] = { "libcups", +                               "libcups.so", +                               "libcups.so.1", +                               "libcups.so.2", +                               NULL };      if (printer_list)  	g_free(printer_list);      if (!(cupsGetPrinters && cupsGetDefault)) { -	cups = g_module_open("libcups", G_MODULE_BIND_LAZY); -	if (!cups) { +        int i; +         +        for (i = 0; libcups[i] != NULL; i++) { +            cups = g_module_open(libcups[i], G_MODULE_BIND_LAZY); +            if (cups) +                break; +        } +         +        if (!cups) {  	    printer_list = g_strdup("[Printers]\n" -				    "CUPS libraries cannot be found="); +	                            "CUPS libraries cannot be found=");  	    return;  	} @@ -38,7 +50,8 @@ scan_printers(void)  	    || !g_module_symbol(cups, "cupsGetDefault",  				(gpointer) & cupsGetDefault)) {  	    printer_list = -		g_strdup("[Printers]\n" "No suitable CUPS library found="); +		g_strdup("[Printers]\n" +                         "No suitable CUPS library found=");              g_module_close(cups);  	    return;  	} @@ -62,6 +75,7 @@ scan_printers(void)  	    g_free(printers[i]);  	}      } else { -	printer_list = g_strdup("[Printers]\n" "No printers found"); +	printer_list = g_strdup("[Printers]\n" +	                        "No printers found");      }  } | 
