Re: [PATCH] mmap error handling

2005-07-29 Thread Pavel Roskin
Hi, Linus! On Thu, 2005-07-28 at 17:30 -0700, Linus Torvalds wrote: _always_ save the value of errno before doing any other calls. Even successful calls are perfectly allowed to change errno. OK. Fixed patch below. Signed-off-by: Pavel Roskin [EMAIL PROTECTED] diff --git a/diff.c b/diff.c

Re: [PATCH] mmap error handling

2005-07-28 Thread Morten Welinder
I have verified that successful close() after failed mmap() won't reset the output of perror() to Success. Does $standard guarantee that? In general, successful libc calls can set errno to whatever they please, except zero. And they sometimes do. This follows from C99. Morten - To

Re: [PATCH] mmap error handling

2005-07-28 Thread Linus Torvalds
On Thu, 28 Jul 2005, Morten Welinder wrote: I have verified that successful close() after failed mmap() won't reset the output of perror() to Success. Does $standard guarantee that? In general, successful libc calls can set errno to whatever they please, except zero. And they