Reopen a connection while performing recovery
#include <ha/fcntl.h> int ha_reopen(int oldfd, const char *path, int oflag, ...);
libha
You can use the ha_reopen() convenience function to reopen a connection while in the recovery phase. The oldfd argument refers to the connection that has failed. The ha_reopen() function closes the previous connection and opens a new connection using the parameters specified by calling open().
The ha_reopen() function also verifies that the new connection ID returned is the same as the oldfd (as required by the HA library mechanism). If the new connection ID obtained is not the same as oldfd, it will attempt to obtain the same fd, by calling the dup2() function.
A new connection ID or -1 if an error occurred (errno is set).
The ha_reopen() call returns errors as returned by the underlying open() call.