Review Board 1.7.16


inotify support for checking timezone file modification

Review Request #136 - Created Jan. 27, 2009 and submitted

Tilghman Lesher
trunk
14300
Reviewers
asterisk-dev
Asterisk
Use the inotify(7) interface to delete cached timezone entries, when the underlying file changes.
Compile-time only.
Review request changed
Updated (Feb. 3, 2009, 6:07 a.m.)
Posted (Feb. 13, 2009, 10:41 a.m.)

   

  
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
If inotify_fd does not have O_NONBLOCK set, I don't see how errno could get set to EAGAIN. I guess it doesn't hurt to check for it though.
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
Why poll and not something like nanosleep?
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
Check for error here
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
Using poll seems like an odd choice. Why not, say, nanosleep?
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
 
Check for errors in stat and lstat
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
 
 
 
 
 
 
 
 
Be sure to check for errors in ast_pthread_create_background, stat, and lstat
Posted (Feb. 25, 2009, 4:06 a.m.)

   

  
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
 
 
For the HAVE_INOTIFY case, there should be an int array to store the watch descriptors.
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
buf.iev.name is only populated when watching a directory and a file inside it changes.  For our use, buf.iev.wd should be compared against stored values for the watch descriptors returned from inotify_add_watch.
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
 
 
 
The watch descriptors returned from inotify_add_watch need to be stored in sp, as decribed earlier.

As well, the IN_CLOSE_WRITE flag should be included since, in my testing, IN_MODIFY doesn't trigger an event when a file is modified but the inode doesn't change.
/trunk/main/stdtime/localtime.c (Diff revision 2)
 
 
This should be using name instead of fullname.

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.