diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/ki/kcldpr.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/ki/kcldpr.x')
-rw-r--r-- | sys/ki/kcldpr.x | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/ki/kcldpr.x b/sys/ki/kcldpr.x new file mode 100644 index 00000000..43060701 --- /dev/null +++ b/sys/ki/kcldpr.x @@ -0,0 +1,44 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include <config.h> +include "ki.h" + +# KCLDPR -- Close a detached process. + +procedure kcldpr (jobcode, killflag, exit_status) + +int jobcode # channel descriptor +int killflag # kill job or just wait for it to terminate +int exit_status # exit status of the job + +int server +int ki_sendrcv() +include "kichan.com" +include "kii.com" + +begin + # Possible if an abort occurs during the open. + if (jobcode <= 0) { + exit_status = OK + return + } + + server = k_node[jobcode] + + if (server == NULL) { + call zcldpr (k_oschan[jobcode], killflag, exit_status) + + } else { + p_arg[1] = k_oschan[jobcode] + p_arg[2] = killflag + p_sbuflen = 0 + + if (ki_sendrcv (server, KI_ZCLDPR, 0) == ERR) + exit_status = ERR + else + exit_status = p_arg[1] + } + + call ki_freechan (jobcode) +end |