]> granicus.if.org Git - postgresql/commitdiff
Previous patch had no detectable virtue other than being a one-liner.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Oct 2010 19:26:24 +0000 (15:26 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Oct 2010 19:26:24 +0000 (15:26 -0400)
Try to make the code look self-consistent again, so it doesn't confuse
future developers.

src/backend/postmaster/postmaster.c

index f24a091ef8b3b08f6a67e2c3c2d88a7f9f1ef721..0fb11833fa8dd91bd3ed41118380d7c20407163e 100644 (file)
@@ -1956,6 +1956,8 @@ canAcceptConnections(void)
 
 /*
  * ConnCreate -- create a local connection data structure
+ *
+ * Returns NULL on failure, other than out-of-memory which is fatal.
  */
 static Port *
 ConnCreate(int serverFd)
@@ -1977,17 +1979,15 @@ ConnCreate(int serverFd)
                ConnFree(port);
                return NULL;
        }
-       else
-       {
-               /*
-                * Precompute password salt values to use for this connection. It's
-                * slightly annoying to do this long in advance of knowing whether
-                * we'll need 'em or not, but we must do the random() calls before we
-                * fork, not after.  Else the postmaster's random sequence won't get
-                * advanced, and all backends would end up using the same salt...
-                */
-               RandomSalt(port->md5Salt);
-       }
+
+       /*
+        * Precompute password salt values to use for this connection. It's
+        * slightly annoying to do this long in advance of knowing whether
+        * we'll need 'em or not, but we must do the random() calls before we
+        * fork, not after.  Else the postmaster's random sequence won't get
+        * advanced, and all backends would end up using the same salt...
+        */
+       RandomSalt(port->md5Salt);
 
        /*
         * Allocate GSSAPI specific state struct