提交 140d8966 编写于 作者: 盏一 提交者: Paul Guo

Fix the bug that GPFDIST_WATCHDOG_TIMER doesn't work.

Just like `man strtol` says:

>   the calling program should set errno to 0 before the call, and then determine if
>   an error occurred by checking whether errno has a nonzero value after the call.

Cherry-picked from 6e76d8a1
上级 e2cffa0e
......@@ -3608,6 +3608,7 @@ int gpfdist_init(int argc, const char* const argv[])
if (wd != NULL)
{
errno = 0;
val = strtol(wd, &endptr, 10);
if (errno || endptr == wd || val > INT_MAX)
......
......@@ -2,10 +2,17 @@
GPFDIST_PID=gpfdist.pid
export GPFDIST_WATCHDOG_TIMER=3
export GPFDIST_WATCHDOG_TIMER=5
gpfdist &
PID=$!
sleep 3
ps -p $PID
if [ $? -ne 0 ]; then
wait $PID
echo "gpfdist should be running, failed"
exit 1
fi
sleep 5
ps -p $PID
if [ $? -eq 0 ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册