comparison dbutil.c @ 1460:58a74cb829b8

Pointer parameter could be declared as pointing to const (callback)
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Aug 2017 22:39:53 +0200
parents bbc0a0ee3843
children fb90a5ba84e0
comparison
equal deleted inserted replaced
1459:06d52bcb8094 1460:58a74cb829b8
239 /* Sets up a pipe for a, returning three non-blocking file descriptors 239 /* Sets up a pipe for a, returning three non-blocking file descriptors
240 * and the pid. exec_fn is the function that will actually execute the child process, 240 * and the pid. exec_fn is the function that will actually execute the child process,
241 * it will be run after the child has fork()ed, and is passed exec_data. 241 * it will be run after the child has fork()ed, and is passed exec_data.
242 * If ret_errfd == NULL then stderr will not be captured. 242 * If ret_errfd == NULL then stderr will not be captured.
243 * ret_pid can be passed as NULL to discard the pid. */ 243 * ret_pid can be passed as NULL to discard the pid. */
244 int spawn_command(void(*exec_fn)(void *user_data), void *exec_data, 244 int spawn_command(void(*exec_fn)(const void *user_data), const void *exec_data,
245 int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid) { 245 int *ret_writefd, int *ret_readfd, int *ret_errfd, pid_t *ret_pid) {
246 int infds[2]; 246 int infds[2];
247 int outfds[2]; 247 int outfds[2];
248 int errfds[2]; 248 int errfds[2];
249 pid_t pid; 249 pid_t pid;