[haiku-commits] Re: haiku: hrev43681 - in src: add-ons/mail_daemon/inbound_protocols/imap kits/mail

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Sun, 22 Jan 2012 09:07:36 -0600

On 22.01.2012 02:51, Jérôme Duval wrote:
Hi Alexander,

2012/1/22  <kallisti5@xxxxxxxxxxx>:
       fSocket = socket(address.Family(), SOCK_STREAM, 0);
-       if (fSocket < 0)
+       if (fSocket < 0) {
+               TRACE("%s: Socket Error: %s\n", __func__, strerror(status));
               return errno;
+       }

       int result = connect(fSocket, address, address.Length());
       if (result < 0) {
+               TRACE("%s: Connect Error: %s\n", __func__, strerror(result));
               close(fSocket);
-               return errno;
+               return result;
       }

socket() and connect() put error codes in errno. strerror(status) and
strerror(result) will for sure be wrong.
Why returning result and not anymore errno? "correct error code" in
your commit message would mean -1.

Baahh.. You're right..  I forgot all about that.

Fixing now.

Other related posts: