[desktop-discuss] Trouble compiling gnome-cups-manager 0.32

David Clack david.clack at sun.com
Sun Jan 7 12:07:08 PST 2007


Hi All,

 This code will not compile using gcc or sunstudio, can a C hacker tell me whats wrong please ?

 It will compile on Ubuntu 6.10.

 It comes from the current gnome cvs.

Thanks
  Dave

static GSList *
get_cups_backend_devices (const char *backend)
{
	char *argv[2], *path, *stdout, *inptr;
	LocalPrinter *desc;
	GSList *ret = NULL;
	
	path = g_alloca (sizeof (CUPS_BACKENDS_DIR) + sizeof (G_DIR_SEPARATOR_S) + strlen (backend) + 1);
	sprintf (path, "%s%s%s", CUPS_BACKENDS_DIR, G_DIR_SEPARATOR_S, backend); 
	
	argv[0] = path;
	argv[1] = NULL;
	
	if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_STDERR_TO_DEV_NULL,
			   NULL, NULL, &stdout, NULL, NULL, NULL))
		return NULL; 
	
	inptr = stdout;
	while ((desc = parse_cups_backend_device_list (&inptr))) {
		if (!strcmp (backend, "hal") && !strcmp (desc->uri, "hal")) {
			
			local_printer_free (desc);
			break;
		} else if (!strcmp (backend, "usb") && !strncmp (desc->uri, "usb:/dev", 8)) {
			
			local_printer_free (desc);
			break;
		} 
		
		ret = g_slist_prepend (ret, desc);
	}
	
	g_free (stdout);
	
	return ret;
}
 
 
This message posted from opensolaris.org



More information about the desktop-discuss mailing list