From: Lars Grunewaldt <lgw@dark-reality.de>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] rctest.c : question about do_listen function
Date: Mon, 29 Nov 2004 20:10:39 +0100 [thread overview]
Message-ID: <41AB742F.7030807@dark-reality.de> (raw)
In-Reply-To: <BAY102-F33BFE2838AD565BE5C0FE1D2BD0@phx.gbl>
-----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
next prev parent reply other threads:[~2004-11-29 19:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-29 19:00 [Bluez-devel] rctest.c : question about do_listen function theresa g.
2004-11-29 19:10 ` Lars Grunewaldt [this message]
2004-11-30 0:46 ` theresa g.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41AB742F.7030807@dark-reality.de \
--to=lgw@dark-reality.de \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox