[hipl-commit] [trunk] Rev 4637: lib: core: fix signedness issues in the message code.

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Sun, 30 May 2010 22:54:33 +0300

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 30/05/2010 at 22:54:33
Revision: 4637
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  lib: core: fix signedness issues in the message code.

Modified:
  M  lib/core/message.c
  M  lib/core/message.h

=== modified file 'lib/core/message.c'
--- lib/core/message.c  2010-05-30 16:20:44 +0000
+++ lib/core/message.c  2010-05-30 19:54:08 +0000
@@ -91,7 +91,7 @@
  */
 int hip_peek_recv_total_len(int sockfd,
                             int encap_hdr_size,
-                            unsigned long timeout)
+                            long timeout)
 {
     int bytes                  = 0, err = 0, flags = MSG_PEEK;
     unsigned long timeout_left = timeout;
@@ -376,7 +376,7 @@
                  "orderly shutdown.\n");
         // Note. This is not an error condition, thus we return zero.
         goto out_err;
-    } else if (n < sizeof(struct hip_common)) {
+    } else if (n < (int)sizeof(struct hip_common)) {
         HIP_ERROR("Could not receive message from daemon.\n");
         goto out_err;
     }

=== modified file 'lib/core/message.h'
--- lib/core/message.h  2010-05-26 10:28:47 +0000
+++ lib/core/message.h  2010-05-30 19:54:08 +0000
@@ -20,7 +20,7 @@
 
 #define HIP_DEFAULT_MSG_TIMEOUT 4000000000ul /* nanosecs */
 
-int hip_peek_recv_total_len(int socket, int encap_hdr_size, unsigned long 
timeout);
+int hip_peek_recv_total_len(int socket, int encap_hdr_size, long timeout);
 int hip_daemon_connect(int hip_user_sock);
 int hip_daemon_bind_socket(int socket, struct sockaddr *sa);
 int hip_send_recv_daemon_info(struct hip_common *msg,

Other related posts:

  • » [hipl-commit] [trunk] Rev 4637: lib: core: fix signedness issues in the message code. - Mircea Gherzan