better error code interpretation
authorJohn Kohl <jtkohl@mit.edu>
Fri, 4 Jan 1991 14:52:35 +0000 (14:52 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 4 Jan 1991 14:52:35 +0000 (14:52 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1617 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/destroy/kdb5_destroy.c

index 3d9d22775109e663bdc338cb8d3ad3a202d40a34..a1a7e4a6a698217610fc51263372cb0ca197ee28 100644 (file)
@@ -84,7 +84,14 @@ char *argv[];
        if (unlink(dbfilename) == -1) {
            retval = errno;
            com_err(argv[0], retval, "deleting database file '%s'",dbfilename);
-           goto aborted;
+           if (retval == ENOENT)
+                   fprintf(stderr,
+                           "Database appears to not exist--inspect files manually!\n");
+               else
+                   fprintf(stderr,
+                           "Database may be partially deleted--inspect files manually!\n");
+
+           exit(1);
        }
        (void) strcpy(dbfilename, dbname);
        (void) strcat(dbfilename, ".pag");
@@ -92,7 +99,7 @@ char *argv[];
            retval = errno;
            com_err(argv[0], retval, "deleting database file '%s'",dbfilename);
            fprintf(stderr,
-                   "Database partially deleted--inspect files manually!\n");
+                   "Database may be partially deleted--inspect files manually!\n");
            exit(1);
        }
        (void) strcpy(dbfilename, dbname);
@@ -107,7 +114,5 @@ char *argv[];
        printf("** Database '%s' destroyed.\n", dbname);
        exit(0);
     }
- aborted:
-    printf("** Destruction aborted--database left intact.\n");
     exit(1);
 }