openbsd-ports/cad/chipmunk/patches/patch-log_src_log_c
pvalchev 7913918505 Import of chipmunk-1.57
Tools for schematic capture, netlist creation, and analog and digital
simulation (log), IC mask layout, extraction, and DRC (wol), simple
chip compilation (wolcomp), MOSIS fabrication request generation
(mosis), netlist comparison (netcmp), data plotting (view) and
postscript graphics editing (until). These tools were used exclusively
for the design and test of all the integrated circuits described in
Carver Mead's book "Analog VLSI and Neural Systems".  Until was used
as the primary tool for figure creation for the book.  The directory
also contains an example of an analog VLSI chip that was designed and
fabricated with these tools, and an example of an Actel
field-programmable gate array design that was simulated and converted
to Actel format with these tools (example).

These tools were originally written for HP 200 Series ("Chipmunk")
computers, and were later ported to Unix and the X Window System.
2003-10-25 18:33:27 +00:00

34 lines
970 B
Plaintext

$OpenBSD: patch-log_src_log_c,v 1.1.1.1 2003/10/25 18:33:27 pvalchev Exp $
--- log/src/log.c.orig 2003-03-12 15:49:30.000000000 -0700
+++ log/src/log.c 2003-10-25 10:51:32.000000000 -0600
@@ -21278,6 +21278,9 @@ Static Void initialize()
short FORLIM;
nk_keytransinfo *WITH;
log_sigrec *WITH1;
+ int fd = -1;
+ char tmpf[25] = "/tmp/chipmunk.XXXXXXXXXX";
+ FILE *tmpp;
#ifdef OS2
_control87(EM_UNDERFLOW, EM_UNDERFLOW); /* Turn off underflow exception. */
@@ -21576,8 +21579,17 @@ Static Void initialize()
if (flag) {
if (libf1[k]->f != NULL)
rewind(libf1[k]->f);
- else
- libf1[k]->f = tmpfile();
+ else {
+ if ((fd = mkstemp(tmpf)) == -1 ||
+ (tmpp = fdopen(fd, "w+")) == NULL) {
+ if (fd != -1) {
+ unlink(tmpf);
+ close(fd);
+ }
+ libf1[k]->f = NULL;
+ } else
+ libf1[k]->f = tmpp;
+ }
if (libf1[k]->f == NULL) {
P_escapecode = -10;
P_ioresult = FileNotFound;