]> granicus.if.org Git - postgresql/commitdiff
Remove feof(stdin) calls related to when to prompt for a password,
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 25 Feb 2009 13:24:40 +0000 (13:24 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 25 Feb 2009 13:24:40 +0000 (13:24 +0000)
leftovers from when the password was read from stdin.

contrib/oid2name/oid2name.c
contrib/pgbench/pgbench.c
contrib/vacuumlo/vacuumlo.c
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_dumpall.c
src/bin/psql/startup.c
src/bin/scripts/common.c

index 86c2ead377279e92802598030dc0bae33f4db471..0e59cc3afde005560e14260dbbf71d7afda700bc 100644 (file)
@@ -5,7 +5,7 @@
  * Originally by
  * B. Palmer, bpalmer@crimelabs.net 1-17-2001
  *
- * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.33 2007/12/11 02:31:49 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/oid2name/oid2name.c,v 1.34 2009/02/25 13:24:40 petere Exp $
  */
 #include "postgres_fe.h"
 
@@ -293,8 +293,7 @@ sql_conn(struct options * my_opts)
 
                if (PQstatus(conn) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(conn) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(conn);
                        password = simple_prompt("Password: ", 100, false);
index 03ce502f922b9845e38a23397aa550bef0f1c2f4..4cc7b8b19ee1aa884a42c17dedc09081f10afd4e 100644 (file)
@@ -4,7 +4,7 @@
  * A simple benchmark program for PostgreSQL
  * Originally written by Tatsuo Ishii and enhanced by many contributors.
  *
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.83 2009/01/01 17:23:32 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.84 2009/02/25 13:24:40 petere Exp $
  * Copyright (c) 2000-2009, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -309,8 +309,7 @@ doConnect(void)
 
                if (PQstatus(conn) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(conn) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(conn);
                        password = simple_prompt("Password: ", 100, false);
index d1450a0ebe2b62c0404edd0a1c0ea7667edf1c86..515cc23576d4952e3057f42cd4ff563f7207fd13 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.37 2009/01/01 17:23:32 momjian Exp $
+ *       $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.38 2009/02/25 13:24:40 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -91,8 +91,7 @@ vacuumlo(char *database, struct _param * param)
 
                if (PQstatus(conn) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(conn) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(conn);
                        password = simple_prompt("Password: ", 100, false);
index 89fbabdfe6db4acb6134c984b0a21056762338c1..f1b755b33bcc5a769343ff6b9e1b7976058c66d3 100644 (file)
@@ -5,7 +5,7 @@
  *     Implements the basic DB functions used by the archiver.
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.81 2009/02/02 20:07:37 adunstan Exp $
+ *       $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.82 2009/02/25 13:24:40 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -241,8 +241,7 @@ ConnectDatabase(Archive *AHX,
 
                if (PQstatus(AH->connection) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(AH->connection) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(AH->connection);
                        password = simple_prompt("Password: ", 100, false);
index 799fee7616e73055e020b0d21b28add62d775607..6d0add1eb60cdec84139a18583aa815d711c5073 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.116 2009/02/25 13:03:06 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.117 2009/02/25 13:24:40 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1358,8 +1358,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
 
                if (PQstatus(conn) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(conn) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(conn);
                        password = simple_prompt("Password: ", 100, false);
index b5c8dcea5c89ba17c2ae39bbe3ebf5534235f712..ba4871f88e5b39072832dbbb90ab764153ed6f29 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2009, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.153 2009/01/01 17:23:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.154 2009/02/25 13:24:40 petere Exp $
  */
 #include "postgres_fe.h"
 
@@ -189,8 +189,7 @@ main(int argc, char *argv[])
 
                if (PQstatus(pset.db) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(pset.db) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(pset.db);
                        password = simple_prompt(password_prompt, 100, false);
index 0318f99a2b1ed97c070dfd6047b246abc09bf494..2587f1a99dff4362c077d7ebb41a96b303763fa5 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.33 2009/01/01 17:23:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.34 2009/02/25 13:24:40 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -124,8 +124,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
 
                if (PQstatus(conn) == CONNECTION_BAD &&
                        PQconnectionNeedsPassword(conn) &&
-                       password == NULL &&
-                       !feof(stdin))
+                       password == NULL)
                {
                        PQfinish(conn);
                        password = simple_prompt("Password: ", 100, false);