*** empty log message ***
authorJohn Kohl <jtkohl@mit.edu>
Tue, 3 Jul 1990 15:38:19 +0000 (15:38 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Tue, 3 Jul 1990 15:38:19 +0000 (15:38 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1032 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/fcc_errs.c [new file with mode: 0644]

diff --git a/src/lib/krb5/ccache/file/fcc_errs.c b/src/lib/krb5/ccache/file/fcc_errs.c
new file mode 100644 (file)
index 0000000..6f50ec0
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * error code interpretation routine
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_fcc_errs_c [] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+
+#include "fcc.h"
+
+krb5_error_code
+krb5_fcc_interpret(errnum)
+int errnum;
+{
+    register int retval;
+    switch (errnum) {
+    case ENOENT:
+       retval = KRB5_FCC_NOFILE;
+       break;
+    case EPERM:
+    case EACCES:
+    case EISDIR:
+    case ENOTDIR:
+    case ELOOP:                                /* XXX */
+    case ETXTBSY:
+    case EBUSY:
+    case EROFS:
+       retval = KRB5_FCC_PERM;
+       break;
+    case EINVAL:
+    case EEXIST:                       /* XXX */
+    case EFAULT:
+    case EBADF:
+    case ENAMETOOLONG:
+#ifdef EWOULDBLOCK
+    case EWOULDBLOCK:
+#endif
+       retval = KRB5_FCC_INTERNAL;
+       break;
+#ifdef EDQUOT
+    case EDQUOT:
+#endif
+    case ENOSPC:
+    case EIO:
+    case ENFILE:
+    case EMFILE:
+    case ENXIO:
+    default:
+       retval = KRB5_CC_IO;            /* XXX */
+    }
+    return retval;
+}