- Timestamp:
- Sep 5, 2021, 12:23:19 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_fInotify.c
r506 r568 197 197 /* Blocking read from inotify file descriptor. 198 198 */ 199 len = sh_inotify_read_timeout (buffer, 16384, 1);199 len = sh_inotify_read_timeout (buffer, 16384, 1); 200 200 201 201 if (len > 0) 202 202 { 203 203 struct inotify_event *event; 204 inti = 0;205 204 long i = 0; 205 206 206 while (i < len) 207 207 { -
trunk/src/sh_inotify.c
r496 r568 236 236 int ifd = sh_inotify_getfd(); 237 237 238 len = sl_read_timeout_fd (ifd, buffer, count, timeout, S_FALSE);238 len = sl_read_timeout_fd_once (ifd, buffer, count, timeout, S_FALSE); 239 239 240 240 return len; -
trunk/src/slib.c
r552 r568 2634 2634 2635 2635 2636 int sl_read_timeout_fd(int fd, void * buf_in, size_t count,2637 int timeout, int is_nonblocking)2636 static int sl_read_timeout_fd_int (int fd, void * buf_in, size_t count, 2637 int timeout, int is_nonblocking, int once) 2638 2638 { 2639 2639 int sflags = 0; … … 2684 2684 bytes += byteread; count -= byteread; 2685 2685 buf += byteread; 2686 if (count == 0 )2686 if (count == 0 || once == S_TRUE) 2687 2687 break; 2688 2688 } … … 2768 2768 } 2769 2769 2770 int sl_read_timeout_fd (int fd, void * buf_in, size_t count, 2771 int timeout, int is_nonblocking) 2772 { 2773 return sl_read_timeout_fd_int (fd, buf_in, count, timeout, is_nonblocking, S_FALSE); 2774 } 2775 2776 int sl_read_timeout_fd_once (int fd, void * buf_in, size_t count, 2777 int timeout, int is_nonblocking) 2778 { 2779 return sl_read_timeout_fd_int (fd, buf_in, count, timeout, is_nonblocking, S_TRUE); 2780 } 2781 2770 2782 int sl_read_timeout (SL_TICKET ticket, void * buf_in, size_t count, 2771 2783 int timeout, int is_nonblocking)
Note:
See TracChangeset
for help on using the changeset viewer.