diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/ki/kzclmt.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/ki/kzclmt.x')
-rw-r--r-- | sys/ki/kzclmt.x | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/ki/kzclmt.x b/sys/ki/kzclmt.x new file mode 100644 index 00000000..6d6bbb80 --- /dev/null +++ b/sys/ki/kzclmt.x @@ -0,0 +1,45 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include <config.h> +include <fio.h> +include "ki.h" + +# KZCLMT -- Close a magtape file. + +procedure kzclmt (chan, devpos, status) + +int chan #I channel to be closed +int devpos[ARB] #O receives position information +int status #O close status + +int server +int ki_sendrcv() +include "kichan.com" +include "kii.com" + +begin + # Possible if an abort occurs during the open. + if (chan <= 0) { + status = OK + return + } + + if (k_node[chan] == NULL) + call zzclmt (k_oschan[chan], devpos, status) + else { + server = k_node[chan] + p_arg[1] = k_oschan[chan] + + if (ki_sendrcv (server, KI_ZFIOMT, MT_CL) == ERR) + status = ERR + else { + status = p_arg[1] + call amovi (p_arg[2], devpos, LEN_MTDEVPOS) + } + + call mfree (k_bufp[chan], TY_INT) + } + + call ki_freechan (chan) +end |