Esempio n. 1
0
/* have to do this after getIFuseConn - lock */
int
ifuseReconnect( iFuseConn_t *iFuseConn ) {
    int status = 0;

    if ( iFuseConn == NULL || iFuseConn->conn == NULL ) {
        return USER__NULL_INPUT_ERR;
    }

    rodsLog( LOG_DEBUG, "ifuseReconnect: reconnecting" );
    ifuseDisconnect( iFuseConn );
    status = ifuseConnect( iFuseConn, &MyRodsEnv );
    return status;
}
Esempio n. 2
0
iFuseConn_t *newIFuseConn(int *status) {
    iFuseConn_t *tmpIFuseConn = (iFuseConn_t *) malloc (sizeof (iFuseConn_t));
    if (tmpIFuseConn == NULL) {
        *status = SYS_MALLOC_ERR;
        return NULL;
    }
    bzero (tmpIFuseConn, sizeof (iFuseConn_t));

    INIT_STRUCT_LOCK(*tmpIFuseConn);
    INIT_LOCK(tmpIFuseConn->inuseLock);

    *status = ifuseConnect (tmpIFuseConn, &MyRodsEnv);
	/*rodsLog(LOG_ERROR, "[ NEW IFUSE CONN] %s:%d %p", __FILE__, __LINE__, tmpIFuseConn);*/
    return tmpIFuseConn;

}