diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 18:07:37 -0300 | 
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2024-04-22 18:07:37 -0300 | 
| commit | 41b6cd0cf9e885faf45f0d0a4fa35055495279d7 (patch) | |
| tree | 09dd3d3e220b058a9aa6762dfc60411be2ac2046 /modules/devices | |
| parent | 61a81feb3a316ea18b37ba0142fe895e714d10e5 (diff) | |
| parent | 5bba5c481d7273b475a39eb61e5eacec65d3c8e5 (diff) | |
Update upstream source from tag 'upstream/2.0.5pre'
Update to upstream version '2.0.5pre'
with Debian dir 9973fc57c4c67d50c40723e3e88c9b1c8e78f684
Diffstat (limited to 'modules/devices')
| -rw-r--r-- | modules/devices/printers.c | 14 | ||||
| -rw-r--r-- | modules/devices/x86/x86_data.c | 3 | 
2 files changed, 13 insertions, 4 deletions
| diff --git a/modules/devices/printers.c b/modules/devices/printers.c index fb9389ac..d880e691 100644 --- a/modules/devices/printers.c +++ b/modules/devices/printers.c @@ -42,7 +42,8 @@ struct _CUPSDest {  static int (*cups_dests_get) (CUPSDest **dests) = NULL;  static int (*cups_dests_free) (int num_dests, CUPSDest *dests) = NULL; -static gboolean cups_init = FALSE; +static void (*cups_set_server)(const char *server) = NULL; +volatile static gboolean cups_init = FALSE;  GModule *cups; @@ -66,9 +67,11 @@ init_cups(void)  	}  	if (!g_module_symbol(cups, "cupsGetDests", (gpointer) & cups_dests_get) -	    || !g_module_symbol(cups, "cupsFreeDests", (gpointer) & cups_dests_free)) { -	    if(cups) g_module_close(cups); +	    || !g_module_symbol(cups, "cupsFreeDests", (gpointer) & cups_dests_free) +	    || !g_module_symbol(cups, "cupsSetServer", (gpointer) & cups_set_server)) { +	    g_module_close(cups);  	    cups_init = FALSE; +	    return;  	}      } @@ -190,11 +193,16 @@ scan_printers_do(void)      if (!cups_init) {          init_cups(); +    } +    if(!cups_init) {          printer_icons = g_strdup("");          printer_list = g_strdup(_("[Printers]\n"                                  "No suitable CUPS library found="));          return; +    }else{ +      //only list from our own cups, use ip for faster/secure answer +      cups_set_server("127.0.0.1");      }      /* remove old devices from global device table */ diff --git a/modules/devices/x86/x86_data.c b/modules/devices/x86/x86_data.c index f56e8668..a2f8d7ca 100644 --- a/modules/devices/x86/x86_data.c +++ b/modules/devices/x86/x86_data.c @@ -330,7 +330,7 @@ void cpuflags_x86_init(void)      gchar *flag_json = g_build_filename(g_get_user_config_dir(), "hardinfo2",                                          "cpuflags.json", NULL);      gboolean use_builtin_table = TRUE; - +#if JSON_CHECK_VERSION(0,20,0)      if (!g_file_test(flag_json, G_FILE_TEST_EXISTS))          goto use_builtin_table; @@ -357,6 +357,7 @@ void cpuflags_x86_init(void)  use_builtin_table_with_json:      g_object_unref(parser);  use_builtin_table: +#endif      g_free(flag_json);      if (use_builtin_table) | 
