forked from osmocom/wireshark
Rename local 'pipe_input' so it doesn't shadow global 'pipe_input';
Use consistent indentation and remove trailing whitespace. svn path=/trunk/; revision=36428
This commit is contained in:
parent
f4d68c6a08
commit
18fc4872bc
14
tshark.c
14
tshark.c
|
@ -1870,11 +1870,11 @@ pipe_timer_cb(gpointer data)
|
|||
DWORD avail = 0;
|
||||
gboolean result, result1;
|
||||
DWORD childstatus;
|
||||
pipe_input_t *pipe_input = data;
|
||||
pipe_input_t *pipe_input_p = data;
|
||||
gint iterations = 0;
|
||||
|
||||
|
||||
g_static_mutex_lock (&pipe_input->callback_running);
|
||||
g_static_mutex_lock (&pipe_input_p->callback_running);
|
||||
|
||||
/* try to read data from the pipe only 5 times, to avoid blocking */
|
||||
while(iterations < 5) {
|
||||
|
@ -1882,11 +1882,11 @@ pipe_timer_cb(gpointer data)
|
|||
|
||||
/* Oddly enough although Named pipes don't work on win9x,
|
||||
PeekNamedPipe does !!! */
|
||||
handle = (HANDLE) _get_osfhandle (pipe_input->source);
|
||||
handle = (HANDLE) _get_osfhandle (pipe_input_p->source);
|
||||
result = PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL);
|
||||
|
||||
/* Get the child process exit status */
|
||||
result1 = GetExitCodeProcess((HANDLE)*(pipe_input->child_process),
|
||||
result1 = GetExitCodeProcess((HANDLE)*(pipe_input_p->child_process),
|
||||
&childstatus);
|
||||
|
||||
/* If the Peek returned an error, or there are bytes to be read
|
||||
|
@ -1897,10 +1897,10 @@ pipe_timer_cb(gpointer data)
|
|||
/*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: data avail");*/
|
||||
|
||||
/* And call the real handler */
|
||||
if (!pipe_input->input_cb(pipe_input->source, pipe_input->user_data)) {
|
||||
if (!pipe_input_p->input_cb(pipe_input_p->source, pipe_input_p->user_data)) {
|
||||
g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: input pipe closed, iterations: %u", iterations);
|
||||
/* pipe closed, return false so that the timer is stopped */
|
||||
g_static_mutex_unlock (&pipe_input->callback_running);
|
||||
g_static_mutex_unlock (&pipe_input_p->callback_running);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1915,7 +1915,7 @@ pipe_timer_cb(gpointer data)
|
|||
|
||||
/*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: finished with iterations: %u, new timer", iterations);*/
|
||||
|
||||
g_static_mutex_unlock (&pipe_input->callback_running);
|
||||
g_static_mutex_unlock (&pipe_input_p->callback_running);
|
||||
|
||||
/* we didn't stopped the timer, so let it run */
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue