From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/boot/bootlib/osclose.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 unix/boot/bootlib/osclose.c (limited to 'unix/boot/bootlib/osclose.c') diff --git a/unix/boot/bootlib/osclose.c b/unix/boot/bootlib/osclose.c new file mode 100644 index 00000000..f9be512c --- /dev/null +++ b/unix/boot/bootlib/osclose.c @@ -0,0 +1,29 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#include /* for close() */ +#include "bootlib.h" + + +/* OS_CLOSE -- Close a file created (opened) by OSCREATE. If writing to a + * text file flush any incomplete (non newline terminated) output line. + */ +void +os_close (int fd) +{ + XINT junk, xfd=fd; + XINT nchars; + + extern int ZPUTTX(), ZCLSTX(); + + + if (osfiletype == BINARY_FILE) + close (fd); + else { + if (txop > text) { + nchars = txop - text; + ZPUTTX (&xfd, text, &nchars, &junk); + } + ZCLSTX (&xfd, &junk); + } +} -- cgit