Re: [PATCH] Cleanup: Use a negative number for uninitialized file descriptors

2016-09-09 Thread Petr Tesarik
Hello Atsushi, On Fri, 9 Sep 2016 06:27:17 + Atsushi Kumagai wrote: > Hello Petr, > > >Do not use zero to denote an invalid file descriptor. > > > >First, zero is a valid value, although quite unlikely to be used for > >anything except standard input. > > >

RE: [PATCH] Cleanup: Use a negative number for uninitialized file descriptors

2016-09-09 Thread Atsushi Kumagai
Hello Petr, >Do not use zero to denote an invalid file descriptor. > >First, zero is a valid value, although quite unlikely to be used for >anything except standard input. > >Second, open(2) returns a negative value on failure, so there are >already checks for a negative value in some places. >

[PATCH] Cleanup: Use a negative number for uninitialized file descriptors

2016-09-06 Thread Petr Tesarik
Do not use zero to denote an invalid file descriptor. First, zero is a valid value, although quite unlikely to be used for anything except standard input. Second, open(2) returns a negative value on failure, so there are already checks for a negative value in some places. The purpose of this