(/home/sate/Testcases/c/cve/wireshark-1.2.0/capture_sync.c) |
| |
| 1021 | | | static gboolean pipe_data_available(int pipe) { |
| 1022 | | | #ifdef _WIN32 |
| 1023 | | | HANDLE hPipe = (HANDLE) _get_osfhandle(pipe); |
| 1024 | | | DWORD bytes_avail; |
| 1025 | | | |
| 1026 | | | if (hPipe == INVALID_HANDLE_VALUE) |
| 1027 | | | return FALSE; |
| 1028 | | | |
| 1029 | | | if (! PeekNamedPipe(hPipe, NULL, 0, NULL, &bytes_avail, NULL)) |
| 1030 | | | return FALSE; |
| 1031 | | | |
| 1032 | | | if (bytes_avail > 0) |
| 1033 | | | return TRUE; |
| 1034 | | | return FALSE; |
| 1035 | | | #else |
| 1036 | | | fd_set rfds; |
| 1037 | | | struct timeval timeout; |
| 1038 | | | |
| 1039 | | | FD_ZERO(&rfds);
x /usr/include/sys/select.h |
| |
96 | #define FD_ZERO(fdsetp) __FD_ZERO (fdsetp) |
| |
x /usr/include/bits/select.h |
| |
34 | # define __FD_ZERO(fdsp) \ |
35 | do { \ |
36 | int __d0, __d1; \ |
37 | __asm__ __volatile__ ("cld; rep; " __FD_ZERO_STOS \ |
38 | : "=c" (__d0), "=D" (__d1) \ |
39 | : "a" (0), "0" (sizeof (fd_set) \ |
40 | / sizeof (__fd_mask)), \ |
41 | "1" (&__FDS_BITS (fdsp)[0]) \ |
42 | : "memory"); \ |
43 | } while (0) |
| |
x /usr/include/bits/select.h |
| |
31 | # define __FD_ZERO_STOS "stosl" |
| |
x /usr/include/sys/select.h |
| |
76 | # define __FDS_BITS(set) ((set)->__fds_bits) |
| |
|
Event 1:
Leaving loop. 0 evaluates to false.
hide
|
|
| 1040 | | | FD_SET(pipe, &rfds);
x /usr/include/sys/select.h |
| |
93 | #define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp) |
| |
x /usr/include/bits/select.h |
| |
59 | #define __FD_SET(d, set) \ |
60 | ((void) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))) |
| |
x /usr/include/sys/select.h |
| |
76 | # define __FDS_BITS(set) ((set)->__fds_bits) |
| |
x /usr/include/sys/select.h |
| |
63 | #define __FDELT(d) ((d) / __NFDBITS) |
| |
x /usr/include/sys/select.h |
| |
62 | #define __NFDBITS (8 * (int) sizeof (__fd_mask)) |
| |
x /usr/include/sys/select.h |
| |
64 | #define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS)) |
| |
x /usr/include/sys/select.h |
| |
62 | #define __NFDBITS (8 * (int) sizeof (__fd_mask)) |
| |
|
| |