Fix wrong usage of volatile declaration.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 30 Mar 2019 01:33:58 +0000 (10:33 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 30 Mar 2019 02:24:59 +0000 (11:24 +0900)
From a PostgreSQL commit message:
     Variables used after a longjmp() need to be declared volatile.  In
     case of a pointer, it's the pointer itself that needs to be declared
     volatile, not the pointed-to value.

Same thing can be said to:
     volatile StartupPacket *sp;

This should have been:
     StartupPacket *volatile sp;

This also suppresses a compiler warning.

src/protocol/child.c

index 4ad2e8e943b231d810223be603e373167ca1394d..cf65e02e25a9111e147dc8499b301f57755678f0 100644 (file)
@@ -2214,7 +2214,7 @@ static void validate_backend_connectivity(int front_end_fd)
                if(front_end_fd > 0)
                {
                        POOL_CONNECTION *cp;
-                       volatile StartupPacket *sp;
+                       StartupPacket *volatile sp;
 
                        /* 
              * we do not want to report socket error, as above errors