proc simuldir: set directory to [xschem current_dirname]/simulation but do not create it until doing the netlist

This commit is contained in:
stefan schippers 2023-11-07 23:39:18 +01:00
parent acbe76329c
commit a128df47e0
2 changed files with 19 additions and 13 deletions

View File

@ -26,11 +26,13 @@
#endif
#include <locale.h>
/* can not install a child handler as the tcl-tk toolkit probably already uses it */
/* #define HANDLE_SIGCHLD */
static void sig_handler(int s){
char emergency_prefix[PATH_MAX];
const char *emergency_dir;
if(s==SIGINT) {
fprintf(errfp, "Use 'exit' to close the program\n");
return;
@ -58,13 +60,13 @@ static void sig_handler(int s){
exit(EXIT_FAILURE);
}
#if 0
#ifdef HANDLE_SIGCHLD
static void child_handler(int signum)
{
/* fprintf(errfp, "SIGCHLD received\n"); */
#ifdef __unix__
wait(NULL);
#endif
fprintf(errfp, "SIGCHLD received\n");
#ifdef __unix__
wait(NULL);
#endif
}
#endif
@ -81,7 +83,10 @@ int main(int argc, char **argv)
signal(SIGILL, sig_handler);
signal(SIGTERM, sig_handler);
signal(SIGFPE, sig_handler);
/* signal(SIGCHLD, child_handler); */ /* avoid zombies 20180925 --> conflicts with tcl exec */
#ifdef HANDLE_SIGCHLD
signal(SIGCHLD, child_handler); /* avoid zombies 20180925 --> conflicts with tcl exec */
#endif
errfp=stderr;
/* 20181013 check for empty or non existing DISPLAY *before* calling Tk_Main or Tcl_Main */

View File

@ -3774,12 +3774,13 @@ proc simuldir {} {
global netlist_dir local_netlist_dir has_x
if { $local_netlist_dir == 1 } {
set simdir [xschem get current_dirname]/simulation
if {[catch {file mkdir "$simdir"} err]} {
puts $err
if {[info exists has_x]} {
tk_messageBox -message "$err" -icon error -parent [xschem get topwindow] -type ok
}
}
# if {[catch {file mkdir "$simdir"} err]} {
# puts $err
# if {[info exists has_x]} {
# tk_messageBox -message "$err" -icon error -parent [xschem get topwindow] -type ok
# }
# }
set netlist_dir $simdir
return $netlist_dir
}