add better error reporting in case of tcp port conflicts

This commit is contained in:
Stefan Frederik 2022-08-27 14:14:06 +02:00
parent 4136f7cf10
commit 3434331f2f
4 changed files with 29 additions and 3 deletions

View File

@ -131,6 +131,7 @@ void deps_default_init(void)
dep_add("libs/time/CLOCK_MONOTONIC_RAW/*",find_time_CLOCK_MONOTONIC_RAW);
dep_add("libs/time/mach_absolute_time/*", find_time_mach_absolute_time);
dep_add("libs/time/QueryPerformanceCounter/*", find_time_QueryPerformanceCounter);
dep_add("libs/time/timeGetTime/*", find_time_timeGetTime);
dep_add("libs/time/gettimeofday/*", find_time_gettimeofday);
dep_add("libs/time/ftime/*", find_time_ftime);
dep_add("libs/time/timegm/*", find_time_timegm);

View File

@ -149,6 +149,7 @@ int find_time_clock_gettime(const char *name, int logdepth, int fatal);
int find_time_CLOCK_MONOTONIC_RAW(const char *name, int logdepth, int fatal);
int find_time_mach_absolute_time(const char *name, int logdepth, int fatal);
int find_time_QueryPerformanceCounter(const char *name, int logdepth, int fatal);
int find_time_timeGetTime(const char *name, int logdepth, int fatal);
int find_time_gettimeofday(const char *name, int logdepth, int fatal);
int find_time_ftime(const char *name, int logdepth, int fatal);
int find_time_timegm(const char *name, int logdepth, int fatal);

View File

@ -86,7 +86,7 @@ static int test_clock_gettime(const char *name_, int logdepth, int fatal, const
NL;
int len = strlen(name_);
/* truncate "/*" from the end of the node name */
/* truncate "/ *" from the end of the node name */
memcpy(name, name_, len);
if (name[len-1] == '*')
name[len-2] = '\0';
@ -165,6 +165,30 @@ int find_time_QueryPerformanceCounter(const char *name, int logdepth, int fatal)
return try_fail(logdepth, "libs/time/QueryPerformanceCounter");
}
int find_time_timeGetTime(const char *name, int logdepth, int fatal)
{
char *test_c =
NL "#include <stdio.h>"
NL "int main() {"
NL " DWORD now;"
NL " now = timeGetTime();"
NL " if (now > 1)"
NL " puts(\"OK\");"
NL " return 0;"
NL "}"
NL;
require("cc/cc", logdepth, fatal);
report("Checking for timeGetTime()... ");
logprintf(logdepth, "find_time_timeGetTime: trying to find timeGetTime...\n");
logdepth++;
if (try_icl(logdepth, "libs/time/timeGetTime", test_c, "#include <windows.h>", NULL, "-lwinmm"))
return 0;
return try_fail(logdepth, "libs/time/timeGetTime");
}
int find_time_gettimeofday(const char *name, int logdepth, int fatal)
{

View File

@ -5506,7 +5506,7 @@ proc setup_tcp_xschem {} {
global xschem_listen_port xschem_server_getdata
if { [info exists xschem_listen_port] && ($xschem_listen_port ne {}) } {
if {[catch {socket -server xschem_server $xschem_listen_port} err]} {
puts "problems listening to TCP port: $xschem_listen_port"
puts "setup_tcp_xschem: problems listening to TCP port: $xschem_listen_port"
puts $err
return 0
} else {
@ -5520,7 +5520,7 @@ proc setup_tcp_bespice {} {
global bespice_listen_port bespice_server_getdata
if { [info exists bespice_listen_port] && ($bespice_listen_port ne {}) } {
if {[catch {socket -server bespice_server $bespice_listen_port} err]} {
puts "problems listening to TCP port: $bespice_listen_port"
puts "setup_tcp_bespice: problems listening to TCP port: $bespice_listen_port"
puts $err
return 0
} else {