Remove NULL checks for AFS_NONNULL parameters
[openafs.git] / src / kauth / kalocalcell.c
index 0081e9c..7c2f499 100644 (file)
@@ -1,56 +1,25 @@
 /*
  * 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>
-#if defined(UKERNEL)
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#endif
-
-RCSID
-    ("$Header$");
-
-#if defined(UKERNEL)
-#include "afs/pthread_glock.h"
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#include "afs_usrops.h"
-#include "afs/cellconfig.h"
-#include "afs/pthread_glock.h"
-#include "rx/xdr.h"
-#include "rx/rx.h"
-#include "afs/kauth.h"
-#include "afs/kautils.h"
-#include "afs/afsutil.h"
-#else /* defined(UKERNEL) */
+
+#include <roken.h>
+#include <afs/opr.h>
+
 #include <afs/pthread_glock.h>
-#include <sys/types.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
 #include <afs/cellconfig.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
+
 #include "kauth.h"
 #include "kautils.h"
-#include <afs/afsutil.h>
-#endif /* defined(UKERNEL) */
 
 /* This is a utility routine that many parts of kauth use but it invokes the
    afsconf package so its best to have it in a separate .o file to make the
@@ -63,11 +32,7 @@ int
 ka_CellConfig(const char *dir)
 {
     int code;
-#ifdef UKERNEL
-    conf = afs_cdir;
-    strcpy(cell_name, afs_LclCellName);
-    return 0;
-#else /* UKERNEL */
+
     LOCK_GLOBAL_MUTEX;
     if (conf)
        afsconf_Close(conf);
@@ -79,24 +44,19 @@ ka_CellConfig(const char *dir)
     code = afsconf_GetLocalCell(conf, cell_name, sizeof(cell_name));
     UNLOCK_GLOBAL_MUTEX;
     return code;
-#endif /* UKERNEL */
 }
 
 char *
 ka_LocalCell(void)
 {
-    int code;
+    int code = 0;
 
     LOCK_GLOBAL_MUTEX;
     if (conf) {
        UNLOCK_GLOBAL_MUTEX;
        return cell_name;
     }
-#ifdef UKERNEL
-    conf = afs_cdir;
-    strcpy(cell_name, afs_LclCellName);
-#else /* UKERNEL */
-    if (conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH)) {
+    if ((conf = afsconf_Open(AFSDIR_CLIENT_ETC_DIRPATH))) {
        code = afsconf_GetLocalCell(conf, cell_name, sizeof(cell_name));
 /* leave conf open so we can lookup other cells */
 /* afsconf_Close (conf); */
@@ -107,7 +67,6 @@ ka_LocalCell(void)
        UNLOCK_GLOBAL_MUTEX;
        return 0;
     }
-#endif /* UKERNEL */
     UNLOCK_GLOBAL_MUTEX;
     return cell_name;
 }
@@ -153,7 +112,7 @@ ka_ExpandCell(char *cell, char *fullCell, int *alocal)
 int
 ka_CellToRealm(char *cell, char *realm, int *local)
 {
-    int code;
+    int code = 0;
 
     LOCK_GLOBAL_MUTEX;
     code = ka_ExpandCell(cell, realm, local);