Commits

Alvaro Herrera  committed 73bcb76

Make stdout unbuffered

This ensures that all stdout output is flushed immediately, to match
stderr. This eliminates the need for fflush(stdout) calls sprinkled all
over the place.

Per Daniel Wood in message 519A79C6.90308@salesforce.com

  • Participants
  • Parent commits 13aa624
  • Branches jsonbuild, master

Comments (0)

Files changed (1)

File src/test/isolation/isolationtester.c

 
 	for (i = 0; i < nconns; i++)
 		PQfinish(conns[i]);
-	fflush(stderr);
-	fflush(stdout);
 	exit(1);
 }
 
 		}
 	}
 
+	/* make stdout unbuffered to match stderr */
+	setbuf(stdout, NULL);
+
 	/*
 	 * If the user supplies a non-option parameter on the command line, use it
 	 * as the conninfo string; otherwise default to setting dbname=postgres
 	/* Clean up and exit */
 	for (i = 0; i < nconns; i++)
 		PQfinish(conns[i]);
-	fflush(stderr);
-	fflush(stdout);
 	return 0;
 }
 
 			 * but it can only be unblocked by running steps from other
 			 * sessions.
 			 */
-			fflush(stdout);
 			fprintf(stderr, "invalid permutation detected\n");
-			fflush(stderr);
 
 			/* Cancel the waiting statement from this session. */
 			cancel = PQgetCancel(conn);
 						testspec->sessions[i]->name,
 						PQerrorMessage(conns[i + 1]));
 				/* don't exit on teardown failure */
-				fflush(stderr);
 			}
 			PQclear(res);
 		}
 			fprintf(stderr, "teardown failed: %s",
 					PQerrorMessage(conns[0]));
 			/* don't exit on teardown failure */
-			fflush(stderr);
 		}
 		PQclear(res);
 	}