Fixed yet another segfault. Added debug messages.

Henning Meier-Geinitz <henning@meier-geinitz.de>
DEVEL_2_0_BRANCH-1
Henning Geinitz 2001-06-03 14:57:00 +00:00
rodzic 6ab8421227
commit d90edc34e2
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -131,6 +131,7 @@ add_device (const char *name, Net_Device ** ndp)
first_device = nd; first_device = nd;
if (ndp) if (ndp)
*ndp = nd; *ndp = nd;
DBG (2, "add_device: backend %s added\n", name);
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
} }
@ -373,6 +374,9 @@ SANE_Status sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize)
} }
fclose (fp); fclose (fp);
} }
else
DBG(1, "sane_init: could not open config file (%s): %s\n", NET_CONFIG_FILE,
strerror (errno));
env = getenv ("SANE_NET_HOSTS"); env = getenv ("SANE_NET_HOSTS");
if (env) if (env)
@ -481,6 +485,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
if (devlist) if (devlist)
{ {
DBG (2, "sane_get_devices: freeing devlist\n");
for (i = 0; devlist[i]; ++i) for (i = 0; devlist[i]; ++i)
{ {
if (devlist[i]->vendor) if (devlist[i]->vendor)
@ -492,8 +497,10 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
free ((void *) devlist[i]); free ((void *) devlist[i]);
} }
free (devlist); free (devlist);
devlist = 0;
} }
devlist_len = 0; devlist_len = 0;
devlist_size = 0;
for (dev = first_device; dev; dev = dev->next) for (dev = first_device; dev; dev = dev->next)
{ {
@ -560,6 +567,7 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only)
devlist[devlist_len++] = 0; devlist[devlist_len++] = 0;
*device_list = devlist; *device_list = devlist;
DBG (2, "sane_get_devices: finished\n");
return SANE_STATUS_GOOD; return SANE_STATUS_GOOD;
} }