Re: Does getopt() return "-1", or "EOF", at end?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Does getopt() return "-1", or "EOF", at end?
Date: 2002-01-09 21:06:49
Message-ID: Pine.LNX.4.30.0201091604370.734-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane writes:

> I notice that in some places we compare the result of getopt(3) to
> "EOF", and in some other places we compare it to "-1". I think we
> should standardize on one or the other; anyone have an opinion
> which it should be?

Definitely "-1", since getopt() comes from unistd.h and EOF is in stdio.h
so EOF is not necessarily available unless the program does stream-based
I/O.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-01-09 21:10:15 Re: Does getopt() return "-1", or "EOF", at end?
Previous Message Marc G. Fournier 2002-01-09 20:49:23 pg_dump bug ... or not?