From de115e539619dd035b5b34be42829943324400a3 Mon Sep 17 00:00:00 2001 From: halfbakery Date: Fri, 14 May 2021 00:27:30 +0200 Subject: [PATCH] the sleep(UINT32_MAX) has exited on OpenWRT instantly --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 40e4d23..5f7bdd7 100644 --- a/main.cpp +++ b/main.cpp @@ -92,7 +92,10 @@ int main(int argc, char **argv) SetThreadName(&threads[i], serial2mqtt[i].getSerialPortShort().c_str()); } - sleep(UINT32_MAX); // UINT32_MAX to sleep 'forever' + for (;;) + { + sleep(INT32_MAX); + } exit(0); return 0;