]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Clean up the #ifdefs around getuerror calls: change KERNEL_HAVE_SETUERROR
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 3 Oct 2002 01:42:43 +0000 (01:42 +0000)
committerNickolai Zeldovich <kolya@mit.edu>
Thu, 3 Oct 2002 01:42:43 +0000 (01:42 +0000)
to KERNEL_HAVE_UERROR, and use that for both setuerror and getuerror.

12 files changed:
src/afs/IRIX/osi_groups.c
src/afs/afs_call.c
src/afs/afs_dcache.c
src/afs/afs_nfsclnt.c
src/afs/afs_osi_pag.c
src/afs/afs_pioctl.c
src/config/param.hp_ux102.h
src/config/param.hp_ux110.h
src/config/param.rs_aix42.h
src/config/param.sgi_62.h
src/config/param.sgi_63.h
src/config/param.sun4_413.h

index 040dcb704ad45d1ada2249745e4c3b455dcf2599..97518a1ef41037f0396446246d37a5ead35c02f4 100644 (file)
@@ -283,7 +283,7 @@ setpag(cred, pagvalue, newpag, change_parent)
     if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
        /* We will have to shift grouplist to make room for pag */
        if (ngroups + 2 > NGROUPS) {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            return (setuerror(E2BIG), E2BIG);
 #else
            return (E2BIG);
@@ -297,7 +297,7 @@ setpag(cred, pagvalue, newpag, change_parent)
     *newpag = (pagvalue == -1 ? genpag(): pagvalue);
     afs_get_groups_from_pag(*newpag, &gidset[0], &gidset[1]);
     if (code = afs_setgroups(cred, ngroups, gidset, change_parent)) {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        return (setuerror(code), code);
 #else
         return code;
index f10e12393d59d726d2f409115ab51ce1b98ab421..5c5c33fc276fe90c25c0c6d642461f9890b133c6 100644 (file)
@@ -323,7 +323,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
     if (!afs_suser() && (parm != AFSOP_GETMTU)
        && (parm != AFSOP_GETMASK)) {
       /* only root can run this code */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        setuerror(EACCES);
        return(EACCES);
 #else
@@ -558,7 +558,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
 
        AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code);
        if (code) {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            setuerror(code);
            code = -1;
 #endif
@@ -741,7 +741,7 @@ long parm, parm2, parm3, parm4, parm5, parm6;
 #ifdef AFS_HPUX_ENV
        vfsmount(parm2, parm3, parm4, parm5);
 #else /* defined(AFS_HPUX_ENV) */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
       setuerror(EINVAL);
 #else
       code = EINVAL;
@@ -1316,7 +1316,7 @@ Afs_syscall ()
 
        code = copyin_iparam((char *)uap->parm3, &iparams);
        if (code) {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            setuerror(code);
 #endif
        } else
@@ -1364,13 +1364,13 @@ Afs_syscall ()
        }
 #else
         if (code) {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            setuerror(code);
 #endif
         }
 #endif /* !AFS_LINUX20_ENV */
     } else {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
         setuerror(EINVAL);
 #else
        code = EINVAL;
@@ -1592,7 +1592,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
     }
 #else
     if (!afs_suser()) {        /* only root can run this code */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        setuerror(EACCES);
        return EACCES;
 #else
index ed7e3a19632860a7b35b9f1d659314762135d13c..0fcfa3cb432a003e3e897aa0ab0e0dbe5ee8678d 100644 (file)
@@ -1258,7 +1258,7 @@ static int afs_UFSCacheStoreProc(register struct rx_call *acall,
        tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen);
        got = afs_osi_Read(afile, -1, tbuffer, tlen);
        if ((got < 0) 
-#if    !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
            || (got != tlen && getuerror())
 #endif
            ) {
@@ -2768,7 +2768,7 @@ struct dcache *afs_UFSGetDSlot(register afs_int32 aslot, register struct dcache
        tdc->f.chunk = -1;
        hones(tdc->f.versionNo);
        tdc->dflags |= DFEntryMod;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
        last_error = getuerror();
 #endif
        lasterrtime = osi_Time();
index fc36d1609366216d17e52c2c4fbcb1aabf3602ad..27481415d0383968d9949dd12bbaf11da9b79c72 100644 (file)
@@ -212,7 +212,7 @@ afs_int32 *pagparam;
 #endif
            if (au) afs_PutUser(au, READ_LOCK);
 /*         ReleaseWriteLock(&afs_xnfsreq);             */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            setuerror(code);
 #endif
            return (code);
@@ -228,7 +228,7 @@ afs_int32 *pagparam;
 #endif
                afs_PutNfsClientPag(np);
 /*             ReleaseWriteLock(&afs_xnfsreq); */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
                setuerror(code);
 #endif
                return (code);
@@ -245,7 +245,7 @@ afs_int32 *pagparam;
                    afs_PutNfsClientPag(np);
                    afs_PutUser(au, READ_LOCK);
                    /*      ReleaseWriteLock(&afs_xnfsreq);     */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
                    setuerror(code);
 #endif
                    return (code);
index 4b4f5216ec70bbec5daaf61282f60e9fce2c44b9..924355afa4a7c668592ae2b2821380664eeb6cda 100644 (file)
@@ -207,16 +207,14 @@ afs_setpag (void)
 #endif
 
     afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
+    if (!getuerror())
+       setuerror(code);
+#endif
 #if defined(AFS_SGI53_ENV) && defined(MP)
     AFS_GUNLOCK();
-#endif /* defined(AFS_SGI53_ENV) && defined(MP) */    
+#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
     return (code);
-#else
-    if (!getuerror())
-       setuerror(code);
-    return (code);
-#endif
 }
 
 #if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS)
@@ -300,16 +298,14 @@ afs_setpag_val (int pagval)
 #endif
 
     afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(KERNEL_HAVE_UERROR)
+    if (!getuerror())
+       setuerror(code);
+#endif
 #if defined(AFS_SGI53_ENV) && defined(MP)
     AFS_GUNLOCK();
 #endif /* defined(AFS_SGI53_ENV) && defined(MP) */    
     return (code);
-#else
-    if (!getuerror())
-       setuerror(code);
-    return (code);
-#endif
 }
 #endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
 
index b1132d7fb2b3253472633cea4f668d34c5fefa2b..ccb6cecab90e54bf12b020a3f3451ed0594261b3 100644 (file)
@@ -671,7 +671,7 @@ int afs_xioctl (void)
 #ifdef AFS_LINUX22_ENV
       return -code;
 #else
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
       if (!getuerror())
          setuerror(code);
 #if    defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV)
@@ -798,7 +798,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
     code = copyin_afs_ioctl(cmarg, &data);
     if (code) {
        PIOCTL_FREE_CRED();
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        setuerror(code);
 #endif
        return (code);
@@ -830,7 +830,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
              crfree(foreigncreds);
          }
          PIOCTL_FREE_CRED();
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
          return (setuerror(code), code);
 #else
          return (code);
@@ -918,7 +918,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
        }
 #endif /* AFS_LINUX22_ENV */
        PIOCTL_FREE_CRED();
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        return (setuerror(code), code);
 #else
        return (code);
@@ -961,7 +961,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
            }
 #endif /* AFS_LINUX22_ENV */
            PIOCTL_FREE_CRED();
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
            return(setuerror(code), code);
 #else
            return (code);
@@ -1026,7 +1026,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
 #endif /* AFS_AIX41_ENV */
 #endif /* AFS_SUN5_ENV */
     } else {
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        setuerror(EINVAL);
 #else
        code = EINVAL;  /* not in /afs */
@@ -1067,7 +1067,7 @@ afs_syscall_pioctl(path, com, cmarg, follow)
 #endif
     }
     PIOCTL_FREE_CRED();
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
     if (!getuerror())  
        setuerror(code);
     return (getuerror());
@@ -2606,7 +2606,7 @@ DECL_PIOCTL(PSetSysName)
     AFS_STATCNT(PSetSysName);
     if (!afs_globalVFS) {
       /* Afsd is NOT running; disable it */
-#if defined(KERNEL_HAVE_SETUERROR)
+#if defined(KERNEL_HAVE_UERROR)
        return (setuerror(EINVAL), EINVAL);
 #else
        return (EINVAL);
index 762787a2488a23649b670e45ea7934e8a55429b6..0a69d60e8617f7c63c891848debf39a1a7d81bde 100644 (file)
@@ -46,7 +46,7 @@
                 }                                       \
                 }
 
-#define KERNEL_HAVE_SETUERROR 1
+#define KERNEL_HAVE_UERROR 1
 
 /* Extra kernel definitions (from kdefs file) */
 #ifdef KERNEL
index 02e3b3e7bd95d5bfacd7dc2bb90a3a18f6cf6531..79b59785b987d490d8af998a06ccfe8fb3e736c7 100644 (file)
@@ -50,7 +50,7 @@
                 }                                       \
                 }
 
-#define KERNEL_HAVE_SETUERROR 1
+#define KERNEL_HAVE_UERROR 1
 
 /* Extra kernel definitions (from kdefs file) */
 #ifdef KERNEL
index 90595be4ad3e4980188d9ec28138a0973cef39a6..327fd01167cc02cd2dfb6fd8341113e091c1958b 100644 (file)
@@ -48,7 +48,7 @@
 #define COMPAT_43
 #endif
 
-#define KERNEL_HAVE_SETUERROR 1
+#define KERNEL_HAVE_UERROR 1
 #define KERNEL_HAVE_PIN 1
 
 /* Extra kernel definitions (from kdefs file) */
index 0803007c286f5ab18d27b2892bd08a8494e3dfee..20e8934d1059bb430e43e443dd73b7df0d74faee 100644 (file)
@@ -63,7 +63,7 @@
 #define SYS_NAME_ID    SYS_NAME_ID_sgi_62
 #define AFSBIG_ENDIAN  1
 
-#define KERNEL_HAVE_SETUERROR 1
+#define KERNEL_HAVE_UERROR 1
 
 /* Extra kernel definitions (from kdefs file) */
 #ifdef KERNEL
index a34237bddec1189b65aca7199f822b580ee2c7fa..6f01cab4deade37dd63f2dc73b50db2ddac6158d 100644 (file)
@@ -55,7 +55,7 @@
 #define AFSBIG_ENDIAN  1
 #define AFS_VM_RDWR_ENV        1
 
-#define KERNEL_HAVE_SETUERROR 1
+#define KERNEL_HAVE_UERROR 1
 /* Extra kernel definitions (from kdefs file) */
 #ifdef KERNEL
 /* definitions here */
index 8fedc5fdfc9b41c4f8c363efff93242586db1caa..c714e01667aef5d157c67fcabf40b6a239ac3efc 100644 (file)
@@ -35,7 +35,7 @@
 #define AFS_HAVE_STATVFS 0\r
 #define AFS_VM_RDWR_ENV        1       /* read/write implemented via VM */\r
 \r
-#define KERNEL_HAVE_SETUERROR 1\r
+#define KERNEL_HAVE_UERROR 1\r
 \r
 /* Extra kernel definitions (from kdefs file) */\r
 #ifdef KERNEL\r