pgpool2.git / summary / log / commit / refs

commit    a9deec0b60a0ab04a6b0c14e7bca2f4ce8eb79c3
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Fri Sep 25 07:37:28 2009 +0000

    Fix write_pid_file. It forgot to write out NULL termination of
    pid. Pgpool occasionally won't stop because of this bug.


main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index e717d67f8..3b37bc2e2 100644 --- a/main.c +++ b/main.c @@ -763,7 +763,7 @@ static void write_pid_file(void) exit(1); } snprintf(pidbuf, sizeof(pidbuf), "%d", (int)getpid()); - fwrite(pidbuf, strlen(pidbuf), 1, fd); + fwrite(pidbuf, strlen(pidbuf)+1, 1, fd); if (fclose(fd)) { pool_error("could not write pid file as %s. reason: %s", [parent: ac74c28f95d6]