From dc541570af14228402a6e9fd39814af9aea2220e Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 4 Jan 1991 14:52:35 +0000 Subject: [PATCH] better error code interpretation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1617 dc483132-0cff-0310-8789-dd5450dbe970 --- src/admin/destroy/kdb5_destroy.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/admin/destroy/kdb5_destroy.c b/src/admin/destroy/kdb5_destroy.c index 3d9d22775..a1a7e4a6a 100644 --- a/src/admin/destroy/kdb5_destroy.c +++ b/src/admin/destroy/kdb5_destroy.c @@ -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); } -- 2.26.2