srv->cli = c;
srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share));
- /* now add it to the cache (internal or external) */
+ /* now add it to the cache (internal or external) */
+ /* Let the cache function set errno if it wants to */
+ errno = 0;
if (context->callbacks.add_cached_srv_fn(context, srv, server, share, workgroup, username)) {
+ int saved_errno = errno;
DEBUG(3, (" Failed to add server to cache\n"));
+ saved_errno = errno;
+ if (errno == 0) {
+ errno = ENOMEM;
+ }
goto failed;
}
-
DEBUG(2, ("Server connect ok: //%s/%s: %p\n",
server, share, srv));