diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/cliconnect.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index c4b491b056..3292b9e1d6 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -626,10 +626,8 @@ BOOL cli_reestablish_connection(struct cli_state *cli) dest_host, &cli->dest_ip, &calling, &called, share, dev, False, do_tcon)) { - if (cli->fd != oldfd) { - if (dup2(cli->fd, oldfd) == oldfd) { - close(cli->fd); - } + if ((cli->fd != oldfd) && (oldfd != -1)) { + close( oldfd ); } return True; } |