return NULL;
}
#endif
+#ifndef afs_strrchr
+char *
+afs_strrchr(char *s, int c)
+{
+ char *p = NULL;
+
+ do {
+ if (*s == c)
+ p = (char*) s;
+ } while (*s++);
+ return p;
+}
+#endif
char *
afs_strdup(char *s)
-/* * * * * * *
- * this code badly needs to be cleaned up... too many ugly ifdefs.
- * XXX
- */
-#if 0
-void
-afs_warn(char *a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j)
-#else
-void
-afs_warn(a, b, c, d, e, f, g, h, i, j)
- char *a;
-#if defined( AFS_USE_VOID_PTR)
- void *b, *c, *d, *e, *f, *g, *h, *i, *j;
-#else
- long b, c, d, e, f, g, h, i, j;
-#endif
-#endif
-{
- AFS_STATCNT(afs_warn);
-
- if (afs_showflags & GAGCONSOLE) {
-#if defined(AFS_AIX_ENV)
- struct file *fd;
-
- /* cf. console_printf() in oncplus/kernext/nfs/serv/shared.c */
- if (fp_open
- ("/dev/console", O_WRONLY | O_NOCTTY | O_NDELAY, 0666, 0, FP_SYS,
- &fd) == 0) {
- char buf[1024];
- ssize_t len;
- ssize_t count;
-
- sprintf(buf, a, b, c, d, e, f, g, h, i, j);
- len = strlen(buf);
- fp_write(fd, buf, len, 0, UIO_SYSSPACE, &count);
- fp_close(fd);
- }
-#else
- printf(a, b, c, d, e, f, g, h, i, j);
-#endif
- }
-}
-
-#if 0
-void
-afs_warnuser(char *a, long b, long c, long d, long e, long f, long g, long h,
- long i, long j)
-#else
-void
-afs_warnuser(a, b, c, d, e, f, g, h, i, j)
- char *a;
- long b, c, d, e, f, g, h, i, j;
-#endif
-{
- AFS_STATCNT(afs_warnuser);
- if (afs_showflags & GAGUSER) {
-#ifdef AFS_GLOBAL_SUNLOCK
- int haveGlock = ISAFS_GLOCK();
- if (haveGlock)
- AFS_GUNLOCK();
-#endif /* AFS_GLOBAL_SUNLOCK */
-
- uprintf(a, b, c, d, e, f, g, h, i, j);
-
-#ifdef AFS_GLOBAL_SUNLOCK
- if (haveGlock)
- AFS_GLOCK();
-#endif /* AFS_GLOBAL_SUNLOCK */
- }
-}
-
-
/* run everywhere, checking locks */
void
afs_CheckLocks(void)
afs_int32 afs_calc_inum (afs_int32 volume, afs_int32 vnode)
{
- afs_int32 ino;
+ afs_int32 ino, vno = vnode;
char digest[16];
struct afs_md5 ct;
AFS_MD5_Update(&ct, &vnode, 4);
AFS_MD5_Final(digest, &ct);
memcpy(&ino, digest, sizeof(ino_t));
- ino ^= (ino ^ vnode) & 1;
+ ino ^= (ino ^ vno) & 1;
} else {
ino = (volume << 16) + vnode;
}