[ekg2-commit] r3848 - trunk/plugins/ioctld: trunk/plugins/ioctld/ioctld.c

SVN commit svn w toxygen.net
Pią, 7 Mar 2008, 18:36:36 CET


Author: peres
Date: 2008-03-07 18:36:36 +0100 (Fri, 07 Mar 2008)
New Revision: 3848

Modified:
   trunk/plugins/ioctld/ioctld.c
Log:

Use socklen_t for recvfrom(); so we need to include 'ekg2-config.h' in ioctld, sorry.



Modified: trunk/plugins/ioctld/ioctld.c
===================================================================
--- trunk/plugins/ioctld/ioctld.c	2008-03-07 17:32:38 UTC (rev 3847)
+++ trunk/plugins/ioctld/ioctld.c	2008-03-07 17:36:36 UTC (rev 3848)
@@ -65,6 +65,10 @@
 #  endif
 #endif
 
+#include "ekg2-config.h" /* because of socklen_t */
+#ifndef HAVE_SOCKLEN_T
+typedef unsigned int socklen_t;
+#endif
 
 char sock_path[PATH_MAX] = "";
 
@@ -159,7 +163,8 @@
 
 int main(int argc, char **argv) 
 {
-    	int sock, length;
+    	int sock;
+	socklen_t length;
 	struct sockaddr_un addr;
 	struct action_data data;
 	
@@ -196,7 +201,7 @@
 	chown(sock_path, getuid(), -1);
 
 	while (1) {
-	    	if (recvfrom(sock, &data, sizeof(data), 0, (struct sockaddr *)&addr,&length) == -1) 
+	    	if (recvfrom(sock, &data, sizeof(data), 0, (struct sockaddr *) &addr, &length) == -1) 
 		    	continue;
 		
 		if (data.act == ACT_BLINK_LEDS)  



Więcej informacji o liście dyskusyjnej ekg2-commit