tsocket: we return -1 on error, not fd
authorAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 01:21:43 +0000 (11:21 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 05:39:36 +0000 (15:39 +1000)
commit0212800de8c6367c9da7939fc43a1fa23c7da2bf
tree1a6f1281cc46b41ec8edcc4d1c239c115a99dfa0
parent0009d1771a757c1df152693840991ecc57564f34
tsocket: we return -1 on error, not fd

the code used this pattent:

 if (fd < 0) {
   ...various cleanups...
   return fd;
 }

it is much clearer to do this:

 if (fd < 0) {
   ...various cleanups...
   return -1;
 }

as otherwise when reading the code you think this function may return
a fd.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
lib/tsocket/tsocket_bsd.c