diff options
Diffstat (limited to 'source3/libsmb/libsmbclient.c')
-rw-r--r-- | source3/libsmb/libsmbclient.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 44cba611d2..0ffc1c1378 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -180,13 +180,14 @@ smbc_parse_path(SMBCCTX *context, const char *fname, char *server, char *share, static int smbc_errno(SMBCCTX *context, struct cli_state *c) { - int ret = cli_errno(c); - + int ret; + if (cli_is_dos_error(c)) { uint8 eclass; uint32 ecode; cli_dos_error(c, &eclass, &ecode); + ret = cli_errno_from_dos(eclass, ecode); DEBUG(3,("smbc_error %d %d (0x%x) -> %d\n", (int)eclass, (int)ecode, (int)ecode, ret)); @@ -194,9 +195,10 @@ static int smbc_errno(SMBCCTX *context, struct cli_state *c) NTSTATUS status; status = cli_nt_error(c); + ret = cli_errno_from_nt(status); DEBUG(3,("smbc errno %s -> %d\n", - nt_errstr(status), ret)); + get_nt_error_msg(status), ret)); } return ret; @@ -211,7 +213,7 @@ static int smbc_errno(SMBCCTX *context, struct cli_state *c) */ int smbc_check_server(SMBCCTX * context, SMBCSRV * server) { - if ( send_keepalive(server->cli.fd) == False ) + if ( cli_send_keepalive(&server->cli) == False ) return 1; /* connection is ok */ @@ -378,7 +380,7 @@ SMBCSRV *smbc_server(SMBCCTX *context, fstring remote_name; struct in_addr rem_ip; - if ((rem_ip.s_addr=inet_addr(server)) == INADDR_NONE) { + if (!inet_aton(server, &rem_ip)) { DEBUG(4, ("Could not convert IP address %s to struct in_addr\n", server)); errno = ENOENT; return NULL; |