diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-01-10 01:11:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-01-10 01:11:45 +0000 |
commit | 92a2598f9744881a99f44f119bb0eb6ccde36c6c (patch) | |
tree | d7ca45d6c4a48156cff396d9889637e984ad64ed /src | |
parent | 4d72af6cb31baa8d92bc86955ea7e5c4bc57eaad (diff) | |
download | postgresql-92a2598f9744881a99f44f119bb0eb6ccde36c6c.tar.gz postgresql-92a2598f9744881a99f44f119bb0eb6ccde36c6c.zip |
The result of getopt() should be compared to -1, not EOF, per
pgsql-hackers discussion of this date.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 4 | ||||
-rw-r--r-- | src/backend/postmaster/postmaster.c | 6 | ||||
-rw-r--r-- | src/backend/tcop/postgres.c | 6 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_restore.c | 5 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 7 |
5 files changed, 13 insertions, 15 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 076b31fb17e..cd118d30d74 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.119 2001/10/25 05:49:22 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.120 2002/01/10 01:11:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -250,7 +250,7 @@ BootstrapMain(int argc, char *argv[]) * variable */ } - while ((flag = getopt(argc, argv, "B:dD:Fo:px:")) != EOF) + while ((flag = getopt(argc, argv, "B:dD:Fo:px:")) != -1) { switch (flag) { diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index f248019d0ab..c480bf2f41f 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.263 2002/01/06 21:40:02 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.264 2002/01/10 01:11:45 tgl Exp $ * * NOTES * @@ -420,7 +420,7 @@ PostmasterMain(int argc, char *argv[]) * with the wrong argument. Death and destruction will occur. */ opterr = 1; - while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1) { switch (opt) { @@ -458,7 +458,7 @@ PostmasterMain(int argc, char *argv[]) optreset = 1; /* some systems need this too */ #endif - while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != EOF) + while ((opt = getopt(argc, argv, "A:a:B:b:c:D:d:Fh:ik:lm:MN:no:p:Ss-:")) != -1) { switch (opt) { diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 68ae795e6a7..0609e1e9531 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.244 2002/01/01 23:16:22 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.245 2002/01/10 01:11:45 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1165,7 +1165,7 @@ PostgresMain(int argc, char *argv[], const char *username) secure = true; ctx = PGC_POSTMASTER; - while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != EOF) + while ((flag = getopt(argc, argv, "A:B:c:CD:d:Eef:FiNOPo:p:S:st:v:W:x:-:")) != -1) switch (flag) { case 'A': @@ -1626,7 +1626,7 @@ PostgresMain(int argc, char *argv[], const char *username) if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.244 $ $Date: 2002/01/01 23:16:22 $\n"); + puts("$Revision: 1.245 $ $Date: 2002/01/10 01:11:45 $\n"); } /* diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 6051dbf83b3..ac740042f42 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -34,7 +34,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.31 2001/11/26 23:10:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.32 2002/01/10 01:11:45 tgl Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * @@ -67,7 +67,6 @@ #include <termios.h> #endif -/* FreeBSD 4.3 seems to put getopt in unistd.h */ #include <unistd.h> #ifdef HAVE_GETOPT_H @@ -164,7 +163,7 @@ main(int argc, char **argv) } #ifdef HAVE_GETOPT_LONG - while ((c = getopt_long(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:", cmdopts, NULL)) != EOF) + while ((c = getopt_long(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:", cmdopts, NULL)) != -1) #else while ((c = getopt(argc, argv, "acCd:f:F:h:i:lL:NoOp:P:rRsS:t:T:uU:vWxX:")) != -1) #endif diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 5e809042155..b6761a6dee1 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -1,4 +1,4 @@ -/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.51 2001/10/28 06:26:11 momjian Exp $ */ +/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.52 2002/01/10 01:11:45 tgl Exp $ */ /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */ /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */ @@ -7,9 +7,8 @@ #include "postgres_fe.h" #include <unistd.h> - #ifdef HAVE_GETOPT_H -#include "getopt.h" +#include <getopt.h> #endif extern int optind; @@ -108,7 +107,7 @@ main(int argc, char *const argv[]) add_include_path("/usr/local/include"); add_include_path("."); - while ((c = getopt(argc, argv, "vo:I:tD:d")) != EOF) + while ((c = getopt(argc, argv, "vo:I:tD:d")) != -1) { switch (c) { |