rx: Introduce rxi_NetSend
[openafs.git] / src / afs / afs_mariner.c
index e1ae262..0ae4d3c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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
@@ -36,10 +36,10 @@ afs_int32 afs_mariner = 0;
 afs_int32 afs_marinerHost = 0;
 
 int
-afs_AddMarinerName(register char *aname, register struct vcache *avc)
+afs_AddMarinerName(char *aname, struct vcache *avc)
 {
-    register int i;
-    register char *tp;
+    int i;
+    char *tp;
 
     AFS_STATCNT(afs_AddMarinerName);
     i = marinerPtr++;
@@ -55,9 +55,9 @@ afs_AddMarinerName(register char *aname, register struct vcache *avc)
 }
 
 char *
-afs_GetMariner(register struct vcache *avc)
+afs_GetMariner(struct vcache *avc)
 {
-    register int i;
+    int i;
     AFS_STATCNT(afs_GetMariner);
     for (i = 0; i < NMAR; i++) {
        if (marinerVCs[i] == avc) {
@@ -68,17 +68,17 @@ afs_GetMariner(register struct vcache *avc)
 }
 
 void
-afs_MarinerLogFetch(register struct vcache *avc, register afs_int32 off,
-                   register afs_int32 bytes, register afs_int32 idx)
+afs_MarinerLogFetch(struct vcache *avc, afs_int32 off,
+                   afs_int32 bytes, afs_int32 idx)
 {
-    return afs_MarinerLog("fetch$Fetching", avc);
+    afs_MarinerLog("fetch$Fetching", avc);
 }                              /*afs_MarinerLogFetch */
 
 void
-afs_MarinerLog(register char *astring, register struct vcache *avc)
+afs_MarinerLog(char *astring, struct vcache *avc)
 {
     struct sockaddr_in taddr;
-    register char *tp, *tp1, *buf;
+    char *tp, *tp1, *buf;
     struct iovec dvec;
 
     AFS_STATCNT(afs_MarinerLog);
@@ -88,21 +88,23 @@ afs_MarinerLog(register char *astring, register struct vcache *avc)
 #ifdef  STRUCT_SOCKADDR_HAS_SA_LEN
     taddr.sin_len = sizeof(taddr);
 #endif
-    tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+    tp = buf = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
 
     strcpy(tp, astring);
     tp += strlen(astring);
-    *tp++ = ' ';
-    tp1 = afs_GetMariner(avc);
-    strcpy(tp, tp1);
-    tp += strlen(tp1);
+    if (avc) {
+       *tp++ = ' ';
+       tp1 = afs_GetMariner(avc);
+       strcpy(tp, tp1);
+       tp += strlen(tp1);
+    }
     *tp++ = '\n';
     /* note, console doesn't want a terminating null */
     /* I don't care if mariner packets fail to be sent */
     dvec.iov_base = buf;
     dvec.iov_len = tp - buf;
     AFS_GUNLOCK();
-    (void)osi_NetSend(afs_server->socket, &taddr, &dvec, 1, tp - buf, 0);
+    (void)rxi_NetSend(afs_server->socket, &taddr, &dvec, 1, tp - buf, 0);
     AFS_GLOCK();
     osi_FreeSmallSpace(buf);
 }                              /*afs_MarinerLog */