login
Header Space

 
 

[PATCH] Fix gcc-4 warning in accept() call

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: git <git@...>
Date: Thursday, September 29, 2005 - 5:05 pm

Fix gcc-4 warning in accept() call

gcc-4 warns about sign mismatch in pointers.  Third argument in accept()
is socklen_t, which is unsigned.  Since Linus doesn't like socklen_t
(see commit 7fa090844f7d1624c7d1ffc621aae6aec84a1110), let's use
unsigned int.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/daemon.c b/daemon.c
--- a/daemon.c
+++ b/daemon.c
@@ -459,7 +459,7 @@ static int serve(int port)
 
 			if (FD_ISSET(sockfd, &fds)) {
 				struct sockaddr_storage ss;
-				int sslen = sizeof(ss);
+				unsigned int sslen = sizeof(ss);
 				int incoming = accept(sockfd, (struct sockaddr *)&ss, &sslen);
 				if (incoming < 0) {
 					switch (errno) {


-- 
Regards,
Pavel Roskin

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix gcc-4 warning in accept() call, Pavel Roskin, (Thu Sep 29, 5:05 pm)
Re: [PATCH] Fix gcc-4 warning in accept() call, Junio C Hamano, (Fri Sep 30, 1:49 am)
Re: [PATCH] Fix gcc-4 warning in accept() call, H. Peter Anvin, (Fri Sep 30, 1:53 am)
Re: [PATCH] Fix gcc-4 warning in accept() call, H. Peter Anvin, (Fri Sep 30, 1:58 am)
Re: [PATCH] Fix gcc-4 warning in accept() call, Junio C Hamano, (Fri Sep 30, 2:21 am)
Re: [PATCH] Fix gcc-4 warning in accept() call , Horst von Brand, (Thu Sep 29, 7:11 pm)
Re: [PATCH] Fix gcc-4 warning in accept() call, Pavel Roskin, (Fri Sep 30, 12:09 am)
Re: [PATCH] Fix gcc-4 warning in accept() call, H. Peter Anvin, (Fri Sep 30, 12:46 am)
speck-geostationary