If we do not shut it down the fd can remain opened. This make impossible
to try a re-connect: busy is returned in this case.
We call shutdown here to make sure that the link is always closed.
#include <fcntl.h>
#include <string.h>
#include <errno.h>
+#include <sys/socket.h>
#include <glib.h>
char *address;
char *name;
+ int fd;
+
DBusPendingCall *call;
};
DBG("%p", bt);
+ shutdown(bt->fd, SHUT_RDWR);
+
CALLBACK_WITH_SUCCESS(cb, data);
}
goto done;
}
+ bt->fd = fd;
+
CALLBACK_WITH_SUCCESS(cb, fd, cbd->data);
done: