summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-17 12:36:18 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-19 12:25:26 -0400
commit1c79ddc8c566a23cf1a77a6a68c65e508fe8ee4d (patch)
treeb38d7c1df35130ad1c82ec7508aee01f5749d494
parent23bb09c919a56768953a71cbbecf735a4bff608b (diff)
downloadhaskell-1c79ddc8c566a23cf1a77a6a68c65e508fe8ee4d.tar.gz
RTS: Fix flag parsing for --eventlog-flush-interval
Fixes #20006
-rw-r--r--rts/RtsFlags.c4
-rw-r--r--testsuite/tests/rts/flags/T20006.hs4
-rw-r--r--testsuite/tests/rts/flags/all.T4
3 files changed, 10 insertions, 2 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 9bf3f692ab..842a461eaa 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -990,8 +990,8 @@ error = true;
printRtsInfo(rtsConfig);
stg_exit(0);
}
- else if (strequal("eventlog-flush-interval=",
- &rts_argv[arg][2])) {
+ else if (!strncmp("eventlog-flush-interval=",
+ &rts_argv[arg][2], 24)) {
OPTION_SAFE;
double intervalSeconds = parseDouble(rts_argv[arg]+26, &error);
if (error) {
diff --git a/testsuite/tests/rts/flags/T20006.hs b/testsuite/tests/rts/flags/T20006.hs
new file mode 100644
index 0000000000..d82a4bd93b
--- /dev/null
+++ b/testsuite/tests/rts/flags/T20006.hs
@@ -0,0 +1,4 @@
+module Main where
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/rts/flags/all.T b/testsuite/tests/rts/flags/all.T
index 6d9368e2c1..04c2907fce 100644
--- a/testsuite/tests/rts/flags/all.T
+++ b/testsuite/tests/rts/flags/all.T
@@ -51,3 +51,7 @@ test('T12870h',
only_ways(['normal'])],
multimod_compile_and_run,
['T12870g', '-rtsopts=ignoreAll -with-rtsopts="-G3"'])
+
+test('T20006', [extra_run_opts('+RTS --eventlog-flush-interval=1')],
+ compile_and_run,
+ ['-eventlog'])