Changeset 10569
- Timestamp:
- May 1, 2010, 3:50:48 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.9x/daemon/watch.c
r10295 r10569 75 75 DIR * odir; 76 76 w->inotify_fd = inotify_init( ); 77 tr_inf( "Using inotify to watch directory \"%s\"", w->dir ); 78 i = inotify_add_watch( w->inotify_fd, w->dir, DTR_INOTIFY_MASK ); 77 78 if( w->inotify_fd < 0 ) 79 { 80 i = -1; 81 } 82 else 83 { 84 tr_inf( "Using inotify to watch directory \"%s\"", w->dir ); 85 i = inotify_add_watch( w->inotify_fd, w->dir, DTR_INOTIFY_MASK ); 86 } 79 87 80 88 if( i < 0 ) 81 89 { 82 tr_err( "Unable to watch \"%s\": %s", w->dir, strerror (errno) );90 tr_err( "Unable to watch \"%s\": %s", w->dir, strerror( errno ) ); 83 91 } 84 92 else if(( odir = opendir( w->dir ))) … … 106 114 watchdir_free_impl( dtr_watchdir * w ) 107 115 { 108 inotify_rm_watch( w->inotify_fd, DTR_INOTIFY_MASK ); 109 close( w->inotify_fd ); 116 if( w->inotify_fd >= 0 ) 117 { 118 inotify_rm_watch( w->inotify_fd, DTR_INOTIFY_MASK ); 119 120 close( w->inotify_fd ); 121 } 110 122 } 111 123 static void
Note: See TracChangeset
for help on using the changeset viewer.