summaryrefslogtreecommitdiff
path: root/rts/RtsFlags.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-10-27 13:16:24 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-10-27 14:11:29 +0100
commit43a92710466737a81a282b294bf3d6c15fc39ebe (patch)
treeb3b724a243987e91a5cfd42970fbd3c87d6867e5 /rts/RtsFlags.c
parent2daa3bd82f4a5a7161bf88c4b8981211c2e8724b (diff)
downloadhaskell-43a92710466737a81a282b294bf3d6c15fc39ebe.tar.gz
Use signed comparison for +RTS -N x <= 0 test
Otherwise we can use +RTS -N-1 and get 2^32 or 2^64 capabilities which doesn't work out so well...
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r--rts/RtsFlags.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index dcfedc0b08..d6da873997 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -1074,18 +1074,19 @@ error = rtsTrue;
RtsFlags.ParFlags.nNodes = getNumberOfProcessors();
#endif
} else {
- RtsFlags.ParFlags.nNodes
- = strtol(rts_argv[arg]+2, (char **) NULL, 10);
- if (RtsFlags.ParFlags.nNodes <= 0) {
+ int nNodes;
+ nNodes = strtol(rts_argv[arg]+2, (char **) NULL, 10);
+ if (nNodes <= 0) {
errorBelch("bad value for -N");
error = rtsTrue;
}
#if defined(PROFILING)
- if (RtsFlags.ParFlags.nNodes > 1) {
+ if (nNodes > 1) {
errorBelch("bad option %s: only -N1 is supported with profiling", rts_argv[arg]);
error = rtsTrue;
}
#endif
+ RtsFlags.ParFlags.nNodes = (nat)nNodes;
}
) break;