From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <41AB742F.7030807@dark-reality.de> From: Lars Grunewaldt MIME-Version: 1.0 To: bluez-devel@lists.sourceforge.net Subject: Re: [Bluez-devel] rctest.c : question about do_listen function References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sender: bluez-devel-admin@lists.sourceforge.net Errors-To: bluez-devel-admin@lists.sourceforge.net Reply-To: bluez-devel@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ development List-Post: List-Help: List-Subscribe: , List-Archive: Date: Mon, 29 Nov 2004 20:10:39 +0100 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | if( listen(s, 10) ) { | syslog(LOG_ERR,"Can not listen on the socket. %s(%d)", | strerror(errno), errno); | exit(1); | } | | I'm somewhat of a newbie to all this stuff (including sockets) so I | question why the listen return is being checked for a 1 for error when | the man pages say -1 is returned on error and 0 is returned on success. If I'm not totally wrong, only "0" is treated as false, why all non-zero values are treated as "true", so the comparison is true for -1... greetings, ~ Lars -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBq3QvQWC6DTWkDAoRAgH6AJ497Ro9tyOh+VhCIli4T8kSo3IktQCgu9/r Al2nU6MplBDnok1+NKzhj3M= =z3q+ -----END PGP SIGNATURE----- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Bluez-devel mailing list Bluez-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-devel