From: Scott Kostyshak Date: Fri, 25 Nov 2022 14:51:30 +0000 (-0500) Subject: Change os::timeout from minutes to milliseconds X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=68c7953422f5f1e05fdc2efd913857836d951fe0;p=features.git Change os::timeout from minutes to milliseconds We can now specify the special value of "-1" milliseconds which is interpreted as disabling the timeout. No change of functionality intended. --- diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 20fe1034b9..7c4eaabc97 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -290,7 +290,7 @@ int Systemcall::startscript(Starttype how, string const & what, } if (!d.waitWhile(SystemcallPrivate::Running, do_events, - os::timeout_min() * 60 * 1000)) { + os::timeout_ms())) { if (d.state == SystemcallPrivate::Killed) { LYXERR0("Killed: " << cmd); return KILLED; diff --git a/src/support/os.cpp b/src/support/os.cpp index 407e1de4fc..8fd64920b8 100644 --- a/src/support/os.cpp +++ b/src/support/os.cpp @@ -45,9 +45,11 @@ namespace lyx { namespace support { namespace os { -int timeout_min() +int timeout_ms() { - return 3; + // return -1 to disable the timeout completely. + // (-1 is a special case in SystemcallPrivate::waitWhile()). + return 3 * 60 * 1000; } diff --git a/src/support/os.h b/src/support/os.h index 07d6d7ba76..d89af7dca4 100644 --- a/src/support/os.h +++ b/src/support/os.h @@ -55,8 +55,8 @@ std::string current_root(); /// shell_type shell(); -/// Returns no. of minutes allowed for a command to complete. -int timeout_min(); +/// Returns no. of milliseconds allowed for a command to complete. +int timeout_ms(); /// Name of the python interpreter /// @param reset True if the python path should be recomputed