Parcourir la source

build: fix cast to void * causing build error

The pid of a process is stored as an integer being passing into the
`timer_add` function as user data that is declared as a `void *`.
Implicit casting from an `integer` to `void *` is generating an error on
gcc.   This patch makes the cast explicit.

Signed-off-by: Keith Holman <keith.holman@windriver.com>
Keith Holman il y a 7 ans
Parent
commit
e57abb3694
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/civetweb.c

+ 1 - 1
src/civetweb.c

@@ -10899,7 +10899,7 @@ handle_cgi_request(struct mg_connection *conn, const char *prog)
 #if defined(USE_TIMERS)
 	// TODO (#618): set a timeout
 	timer_add(
-	    conn->phys_ctx, /* one minute */ 60.0, 0.0, 1, abort_process, pid);
+	    conn->phys_ctx, /* one minute */ 60.0, 0.0, 1, abort_process, (void*)pid);
 #endif
 
 	/* Make sure child closes all pipe descriptors. It must dup them to 0,1