summaryrefslogtreecommitdiffstats
path: root/src/admin/edit/tcl_wrapper.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-09-29 20:27:35 +0000
committerTheodore Tso <tytso@mit.edu>1994-09-29 20:27:35 +0000
commit90b741833353d4c20304f00e16f2d1f9a420d65c (patch)
tree23bb903a657e0a4fb841a346c4788d053bf3c330 /src/admin/edit/tcl_wrapper.c
parent345a24fe4f84f7eb10e0fe68932bcafd399c2328 (diff)
downloadkrb5-90b741833353d4c20304f00e16f2d1f9a420d65c.tar.gz
krb5-90b741833353d4c20304f00e16f2d1f9a420d65c.tar.xz
krb5-90b741833353d4c20304f00e16f2d1f9a420d65c.zip
Exit with a non-zero status if there was an error in an executed command.
(Useful when the -R option is used in a shell-script.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4381 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/admin/edit/tcl_wrapper.c')
-rw-r--r--src/admin/edit/tcl_wrapper.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/admin/edit/tcl_wrapper.c b/src/admin/edit/tcl_wrapper.c
index ab23817090..6391b62aa6 100644
--- a/src/admin/edit/tcl_wrapper.c
+++ b/src/admin/edit/tcl_wrapper.c
@@ -47,6 +47,7 @@ int *tclDummyMainPtr = (int *) main; /* force ld to suck in main()
from libtcl.a */
extern Tcl_Interp *interp; /* XXX yes, this is gross,
but we do need it for some things */
+extern int exit_status;
void show_principal PROTOTYPE((int, char **));
void add_new_key PROTOTYPE((int, char **));
@@ -82,10 +83,7 @@ int doquit(clientData, interp, argc, argv)
return TCL_ERROR;
}
if (argc == 1) {
- if (quit())
- exit(1);
- else
- exit(0);
+ exit(quit() ? 1 : exit_status);
}
if (Tcl_GetInt(interp, argv[1], &value) != TCL_OK) {
return TCL_ERROR;