/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
-#include <string.h>
#include "fsprobe.h" /*Interface for fsprobe module */
#include <afs/afsutil.h>
-
+
/*------------------------------------------------------------------------
* FS_Handler
*
{ /*Main routine */
static char rn[] = "fsprobe_test"; /*Routine name */
- register afs_int32 code; /*Return code */
+ afs_int32 code; /*Return code */
struct sockaddr_in FSSktArray[3]; /*socket array */
struct hostent *he; /*Host entry */
- struct timeval tv; /*Time structure */
int sleep_secs; /*Number of seconds to sleep */
printf("\n\nTest of the fsprobe facility.\n\n");
/*
* Fill in the socket array for bigbird, vice1, and vice2.
*/
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- FSSktArray[0].sin_family = AF_INET; /*Internet family */
-#else
- FSSktArray[0].sin_family = htons(AF_INET); /*Internet family */
-#endif
- FSSktArray[0].sin_port = htons(7000); /*FileServer port */
+ FSSktArray[0].sin_family = AF_INET;
+ FSSktArray[0].sin_port = htons(7000); /* FileServer port */
he = hostutil_GetHostByName("servername1");
if (he == NULL) {
fprintf(stderr, "[%s] Can't get host info for servername1\n", rn);
}
memcpy(&(FSSktArray[0].sin_addr.s_addr), he->h_addr, 4);
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- FSSktArray[1].sin_family = AF_INET; /*Internet address family */
-#else
- FSSktArray[1].sin_family = htons(AF_INET); /*Internet address family */
-#endif
- FSSktArray[1].sin_port = htons(7000); /*FileServer port */
+ FSSktArray[1].sin_family = AF_INET;
+ FSSktArray[1].sin_port = htons(7000); /* FileServer port */
he = hostutil_GetHostByName("servername2");
if (he == NULL) {
fprintf(stderr, "[%s] Can't get host info for servername2\n", rn);
}
memcpy(&(FSSktArray[1].sin_addr.s_addr), he->h_addr, 4);
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- FSSktArray[2].sin_family = AF_INET; /*Internet address family */
-#else
- FSSktArray[2].sin_family = htons(AF_INET); /*Internet address family */
-#endif
- FSSktArray[2].sin_port = htons(7000); /*FileServer port */
+ FSSktArray[2].sin_family = AF_INET;
+ FSSktArray[2].sin_port = htons(7000); /* FileServer port */
he = hostutil_GetHostByName("servername3");
if (he == NULL) {
fprintf(stderr, "[%s] Can't get host info for servername3\n", rn);
("Fsprobe service started, main thread sleeping for %d seconds...\n",
sleep_secs);
- /*
- * Let's just fall asleep for a while, then we'll clean up.
- */
- tv.tv_sec = sleep_secs;
- tv.tv_usec = 0;
- code = IOMGR_Select(0, /*Num fds */
- 0, /*Descriptors ready for reading */
- 0, /*Descriptors ready for writing */
- 0, /*Descriptors with exceptional conditions */
- &tv); /*Timeout structure */
- if (code) {
- fprintf(stderr, "[%s] IOMGR_Select() returned non-zero value: %d\n",
- rn, code);
- }
+ fsprobe_Wait(sleep_secs);
/*
* We're all done. Clean up, put the last nail in Rx, then