diff --git a/cif/CIFhier.c b/cif/CIFhier.c index e985485d..b011c26e 100644 --- a/cif/CIFhier.c +++ b/cif/CIFhier.c @@ -40,6 +40,7 @@ static const char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magi #include "drc/drc.h" #include "graphics/graphics.h" #include "textio/textio.h" +#include "utils/main.h" #include "utils/undo.h" #include "utils/malloc.h" #include "utils/signals.h" @@ -732,7 +733,7 @@ CIFGenSubcells( Tk_RestrictProc *oldProc; ClientData oldArg; - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ oldProc = Tk_RestrictEvents(RestrictInputProc, (ClientData)NULL, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */ @@ -888,7 +889,7 @@ CIFGenSubcells( #ifdef MAGIC_WRAPPER #ifndef MAGIC_NO_TK /* Restore full event access */ - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ Tk_RestrictEvents(oldProc, oldArg, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */ diff --git a/extract/ExtSubtree.c b/extract/ExtSubtree.c index 06d23dab..4e952e9e 100644 --- a/extract/ExtSubtree.c +++ b/extract/ExtSubtree.c @@ -42,6 +42,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/ #include "database/database.h" #include "utils/malloc.h" #include "textio/textio.h" +#include "utils/main.h" #include "debug/debug.h" #include "extract/extract.h" #include "extract/extractInt.h" @@ -190,7 +191,7 @@ extSubtree(parentUse, reg, f) Tk_RestrictProc *oldProc; ClientData oldArg; - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ oldProc = Tk_RestrictEvents(RestrictInputProc, (ClientData)NULL, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */ @@ -389,7 +390,7 @@ done: #ifdef MAGIC_WRAPPER #ifndef MAGIC_NO_TK /* Restore full event access */ - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ Tk_RestrictEvents(oldProc, oldArg, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */ diff --git a/lef/defRead.c b/lef/defRead.c index cac86fde..19e22aae 100644 --- a/lef/defRead.c +++ b/lef/defRead.c @@ -2536,7 +2536,7 @@ DefRead( * corrupt the database during DEF reads. */ - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ oldProc = Tk_RestrictEvents(RestrictInputProc, (ClientData)NULL, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */ @@ -2764,7 +2764,7 @@ DefRead( #ifdef MAGIC_WRAPPER #ifndef MAGIC_NO_TK /* Restore full event access */ - if (SigInterruptOnSigIO != -1) /* Check for batch mode */ + if (TxTkConsole) /* only when a Tk console exists (never in -dnull) */ Tk_RestrictEvents(oldProc, oldArg, &oldArg); #endif /* MAGIC_NO_TK */ #endif /* MAGIC_WRAPPER */