#include <roken.h>
-#include <sys/types.h>
-#include <stdio.h>
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <time.h>
-#else
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-#include <errno.h>
-#include <afs/afs_assert.h>
-#include <signal.h>
-#include <string.h>
-
#include <rx/xdr.h>
#include <afs/afsint.h>
#include "nfs.h"
CallHandler(FSYNC_readfds, nfds, POLLIN|POLLPRI);
#else
int maxfd;
+#ifdef AFS_PTHREAD_ENV
+ struct timeval s_timeout;
+#endif
GetHandler(&FSYNC_readfds, &maxfd);
/* Note: check for >= 1 below is essential since IOMGR_select
* doesn't have exactly same semantics as select.
*/
#ifdef AFS_PTHREAD_ENV
- if (select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1)
+ s_timeout.tv_sec = SYNC_SELECT_TIMEOUT;
+ s_timeout.tv_usec = 0;
+ if (select(maxfd + 1, &FSYNC_readfds, NULL, NULL, &s_timeout) >= 1)
#else /* AFS_PTHREAD_ENV */
if (IOMGR_Select(maxfd + 1, &FSYNC_readfds, NULL, NULL, NULL) >= 1)
#endif /* AFS_PTHREAD_ENV */
if (vp) {
if (FSYNC_partMatch(vcom, vp, 0)) {
- /* null out salvsync control state, as it's no longer relevant */
- memset(&vp->salvage, 0, sizeof(vp->salvage));
-
VCreateReservation_r(vp);
VWaitExclusiveState_r(vp);
VDeregisterVolOp_r(vp);
if (vcom->hdr->reason == FSYNC_SALVAGE) {
FSYNC_backgroundSalvage(vp);
} else {
+ /* null out salvsync control state, as it's no longer relevant */
+ memset(&vp->salvage, 0, sizeof(vp->salvage));
VChangeState_r(vp, VOL_STATE_ERROR);
}
}
VOL_UNLOCK;
RemoveHandler(fd);
-#ifdef AFS_NT40_ENV
- closesocket(fd);
-#else
- close(fd);
-#endif
+ rk_closesocket(fd);
AcceptOn();
}