From e2d1dd47d8f873a10d8f84253182059c50a229c8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 28 Oct 2000 20:54:45 +0000 Subject: Another patch to fix cli_reestablish_connection from Kenichi Okuyama@Tokyo Research Lab. IBM-Japan. Co. Jp. Jeremy. (This used to be commit 06f5da5d4bf044969364afe0298347811fb4ae91) --- source3/libsmb/cliconnect.c | 6 ++---- 1 file 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; } -- cgit