Re: pg_dump return status..

Поиск
Список
Период
Сортировка
От Pete Forman
Тема Re: pg_dump return status..
Дата
Msg-id 14937.41328.109146.47030@kryten.bedford.waii.com
обсуждение исходный текст
Ответ на Re: pg_dump return status..  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: pg_dump return status..  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Philip Warner writes:> At 09:36 8/01/01 +0000, Pete Forman wrote:> >There are no compiler errors, just run time errors
ifyou rely on> >the return from sprintf() being the number of characters.> > All I need to know is how to detect an
error.Does it return EOF on> error?
 

The standard sprintf() returns a negative int on error.  That value
may or may not be EOF.  EOF technically indicates the end of an input
stream.  It has no direct connection with errors writing to streams.

The "BSD" version in Solaris always returns the char* pointer that is
the first argument.  There is no way to check for an error.

Other BSD OSs such as FreeBSD, NetBSD and OpenBSD all conform to C89,
i.e. sprintf() returns an int which is the number of characters
written (excluding '\0') or a negative number for failure.
-- 
Pete Forman                 -./\.- Disclaimer: This post is originated
WesternGeco                   -./\.-  by myself and does not represent
pete.forman@westerngeco.com     -./\.-  opinion of Schlumberger, Baker
http://www.crosswinds.net/~petef  -./\.-  Hughes or their divisions.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: pg_dump return status..
Следующее
От: Marko Kreen
Дата:
Сообщение: Re: patch: contrib/pgcrypto sanity