Subversion Repositories public

Rev

Rev 29 | Rev 35 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29 Rev 33
Line 267... Line 267...
267
  m_fEnabled = fEnabled;
267
  m_fEnabled = fEnabled;
268
 
268
 
269
  IN_WRITE_END
269
  IN_WRITE_END
270
}
270
}
271
271
-
 
272
void InotifyWatch::OnOneshotEvent()
-
 
273
{
-
 
274
  IN_WRITE_BEGIN
-
 
275
 
-
 
276
  if (!m_fEnabled) {
-
 
277
    IN_WRITE_END_NOTHROW
-
 
278
    throw InotifyException(IN_EXC_MSG("event cannot occur on disabled watch"), EINVAL, this);
-
 
279
  }
-
 
280
 
-
 
281
  if (m_pInotify != NULL) {
-
 
282
    m_pInotify->m_watches.erase(m_wd);
-
 
283
    m_wd = -1;
-
 
284
  }
-
 
285
 
-
 
286
  m_fEnabled = false;
-
 
287
 
-
 
288
  IN_WRITE_END
-
 
289
}
-
 
290
272
291
273
Inotify::Inotify() throw (InotifyException)
292
Inotify::Inotify() throw (InotifyException)
274
{
293
{
275
  IN_LOCK_INIT
294
  IN_LOCK_INIT
276
 
295
 
Line 424... Line 443...
424
  while (i < len) {
443
  while (i < len) {
425
    struct inotify_event* pEvt = (struct inotify_event*) &m_buf[i];
444
    struct inotify_event* pEvt = (struct inotify_event*) &m_buf[i];
426
    InotifyWatch* pW = FindWatch(pEvt->wd);
445
    InotifyWatch* pW = FindWatch(pEvt->wd);
427
    if (pW != NULL) {
446
    if (pW != NULL) {
428
      InotifyEvent evt(pEvt, pW);
447
      InotifyEvent evt(pEvt, pW);
-
 
448
      if (InotifyEvent::IsType(pW->GetMask(), IN_ONESHOT))
-
 
449
        pW->OnOneshotEvent();
429
      m_events.push_back(evt);
450
      m_events.push_back(evt);
430
    }
451
    }
431
    i += INOTIFY_EVENT_SIZE + (ssize_t) pEvt->len;
452
    i += INOTIFY_EVENT_SIZE + (ssize_t) pEvt->len;
432
  }
453
  }
433
 
454