Changeset 568 for trunk/src


Ignore:
Timestamp:
Sep 5, 2021, 12:23:19 PM (3 years ago)
Author:
katerina
Message:

Fix for ticket #458 (inotify issue).

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_fInotify.c

    r506 r568  
    197197  /* Blocking read from inotify file descriptor.
    198198   */
    199   len = sh_inotify_read_timeout(buffer, 16384, 1);
     199  len = sh_inotify_read_timeout (buffer, 16384, 1);
    200200 
    201201  if (len > 0)
    202202    {
    203203      struct inotify_event *event;
    204       int i = 0;
    205      
     204      long i = 0;
     205
    206206      while (i < len)
    207207        {
  • trunk/src/sh_inotify.c

    r496 r568  
    236236  int     ifd = sh_inotify_getfd();
    237237
    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);
    239239
    240240  return len;
  • trunk/src/slib.c

    r552 r568  
    26342634
    26352635
    2636 int sl_read_timeout_fd (int fd, void * buf_in, size_t count,
    2637                         int timeout, int is_nonblocking)
     2636static int sl_read_timeout_fd_int (int fd, void * buf_in, size_t count,
     2637                                   int timeout, int is_nonblocking, int once)
    26382638{
    26392639  int sflags = 0;
     
    26842684              bytes += byteread; count -= byteread;
    26852685              buf += byteread;
    2686               if (count == 0)
     2686              if (count == 0 || once == S_TRUE)
    26872687                break;
    26882688            } 
     
    27682768}
    27692769
     2770int 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
     2776int 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
    27702782int sl_read_timeout (SL_TICKET ticket, void * buf_in, size_t count,
    27712783                     int timeout, int is_nonblocking)
Note: See TracChangeset for help on using the changeset viewer.