Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: perror()4 says SUCCESS |
| Date | 2011-11-22 16:43 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <4ECC176A.4020503@verizon.net> (permalink) |
| References | <4ecb7bcf$0$292$14726298@news.sunsite.dk> <8LqdnR2ZJ69qWVbTnZ2dnUVZ7oednZ2d@giganews.com> <lnzkfnu9oi.fsf@nuthaus.mib.org> |
On 11/22/2011 04:30 PM, Keith Thompson wrote:
> Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> writes:
>> arnuld ha scritto:
> [...]
>>> perror("*ERROR in ELSE");
>> [...]
>>
>> Use printf("Error: %s\n", strerror(err)); instead or the Posix
>> compliant and thread safe "strerror_r()".
>
> What's the advantage of that over perror()?
It goes to stdin rather than stderr; though I'm not sure that counts as
and advantage; if stderr is different from stdout, I generally want
messages of this type going to stderr, not stdout. I guess that
Vincenzo's preferences are different.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
perror()4 says SUCCESS arnuld <sunrise@invalid.address> - 2011-11-22 10:39 +0000
Re: perror()4 says SUCCESS jt@toerring.de (Jens Thoms Toerring) - 2011-11-22 11:44 +0000
Re: perror()4 says SUCCESS Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-22 04:15 -0800
Re: perror()4 says SUCCESS Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-22 07:51 -0500
Re: perror()4 says SUCCESS Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-22 16:51 +0100
Re: perror()4 says SUCCESS Keith Thompson <kst-u@mib.org> - 2011-11-22 13:30 -0800
Re: perror()4 says SUCCESS Harald van Dijk <truedfx@gmail.com> - 2011-11-22 13:35 -0800
Re: perror()4 says SUCCESS Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-22 22:51 +0100
Re: perror()4 says SUCCESS James Kuyper <jameskuyper@verizon.net> - 2011-11-22 16:43 -0500
Re: perror()4 says SUCCESS Ben Pfaff <blp@cs.stanford.edu> - 2011-11-22 15:36 -0800
Re: perror()4 says SUCCESS James Kuyper <jameskuyper@verizon.net> - 2011-11-22 18:52 -0500
Re: perror()4 says SUCCESS Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-22 22:50 +0100
Re: perror()4 says SUCCESS Keith Thompson <kst-u@mib.org> - 2011-11-22 13:57 -0800
Re: perror()4 says SUCCESS Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-22 23:05 +0100
Re: perror()4 says SUCCESS Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-22 23:26 +0100
Re: perror()4 says SUCCESS Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-22 20:40 -0500
csiph-web