Remove DUX/OSF code
[openafs.git] / src / vol / devname.c
index a5df6ff..8b03705 100644 (file)
@@ -1,25 +1,24 @@
 /*
  * 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 <sys/param.h>
 #include <afsconfig.h>
+#include <afs/param.h>
 
+#include <roken.h>
+
+#include <ctype.h>
 
-#include <afs/param.h>
 #include <rx/xdr.h>
+#include <rx/rx_queue.h>
 #include <afs/afsint.h>
-#include <string.h>
-#include <ctype.h>
+
 #if !defined(AFS_SGI_ENV)
-#ifdef AFS_OSF_ENV
-#include <ufs/fs.h>
-#else /* AFS_OSF_ENV */
 #ifdef AFS_VFSINCL_ENV
 #define VFS
 #ifdef AFS_SUN5_ENV
 #endif
 #endif
 #else /* AFS_VFSINCL_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_XBSD_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_XBSD_ENV) && !defined(AFS_DARWIN_ENV)
 #include <sys/fs.h>
 #endif
 #endif /* AFS_VFSINCL_ENV */
-#endif /* AFS_OSF_ENV */
 #endif /* AFS_SGI_ENV */
-#include <sys/errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
 #include <sys/file.h>
 #ifdef AFS_AIX_ENV
 #include <sys/vfs.h>
-#include <fcntl.h>
 #else
 #ifdef AFS_HPUX_ENV
-#include <fcntl.h>
 #include <mntent.h>
 #else
 #if    defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
@@ -61,7 +53,6 @@
 #endif
 #else
 #if defined(AFS_SGI_ENV)
-#include <fcntl.h>
 #include <mntent.h>
 #else
 #ifdef AFS_LINUX22_ENV
 #endif /* AFS_SGI_ENV */
 #endif /* AFS_HPUX_ENV */
 #endif
-#include <netdb.h>
-#include <netinet/in.h>
 #include <sys/wait.h>
 #include <setjmp.h>
-#ifndef ITIMER_REAL
-#include <sys/time.h>
-#endif /* ITIMER_REAL */
+
 #include "ihandle.h"
 #include "partition.h"
 
@@ -176,7 +163,7 @@ vol_DevName(dev_t adev, char *wpath)
        if (stat(part, &status) == -1) {
            continue;
        }
-#if !defined(AFS_SGI_XFS_IOPS_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_SGI_XFS_IOPS_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
        if ((status.st_ino !=
             ROOTINO) /*|| ((status.st_mode & S_IFMT) != S_IFBLK) */ ) {
            continue;
@@ -198,14 +185,14 @@ vol_DevName(dev_t adev, char *wpath)
 #endif
            if (wpath) {
                strcpy(pbuf, pbuffer);
-               ptr = (char *)strrchr(pbuf, '/');
+               ptr = (char *)strrchr(pbuf, OS_DIRSEPC);
                if (ptr) {
                    *ptr = '\0';
                    strcpy(wpath, pbuf);
                } else
                    return NULL;
            }
-           ptr = (char *)strrchr(pbuffer, '/');
+           ptr = (char *)strrchr(pbuffer, OS_DIRSEPC);
            if (ptr) {
                strcpy(pbuffer, ptr + 1);
                return pbuffer;
@@ -241,7 +228,7 @@ afs_rawname(char *devfile)
     i = strlen(devfile);
     while (i >= 0) {
        strcpy(rawname, devfile);
-       if (devfile[i] == '/') {
+       if (devfile[i] == OS_DIRSEPC) {
            rawname[i + 1] = 'r';
            rawname[i + 2] = 0;
            strcat(rawname, &devfile[i + 1]);
@@ -251,7 +238,7 @@ afs_rawname(char *devfile)
        if (!code && S_ISCHR(statbuf.st_mode))
            return rawname;
 
-       while ((--i >= 0) && (devfile[i] != '/'));
+       while ((--i >= 0) && (devfile[i] != OS_DIRSEPC));
     }
 
     return NULL;