Re: close return value (was Re: [ANNOUNCE] Ext3 vs Reiserfs

Stevie O (stevie@qrpff.net)
Wed, 17 Jul 2002 00:17:40 -0400


At 07:22 PM 7/16/2002 -0700, Elladan wrote:
> 1. Thread 1 performs close() on a file descriptor. close fails.
> 2. Thread 2 performs open().
>* 3. Thread 1 performs close() again, just to make sure.
>
>
>open() may return any file descriptor not currently in use.

I'm confused here... the only way close() can fail is if the file descriptor is invalid (EBADF); wouldn't it be rather stupid to close() a known-to-be-bad descriptor?

--
Stevie-O

Real programmers use COPY CON PROGRAM.EXE

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/