2009-06-13
* Added support for $to_bytes
+ * Fix segfault due to bad checking of return values for inotify code
+ (sf.net #2804886)
2009-06-12
* Added support for per-task I/O statistics - $top_io
#endif
double t;
#ifdef HAVE_SYS_INOTIFY_H
- int inotify_config_wd = 0;
+ int inotify_config_wd = -1;
#define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))
#define INOTIFY_BUF_LEN (20 * (INOTIFY_EVENT_SIZE + 16))
char inotify_buff[INOTIFY_BUF_LEN];
break;
}
#ifdef HAVE_SYS_INOTIFY_H
- if (inotify_fd && !inotify_config_wd) {
+ if (inotify_fd != -1 && inotify_config_wd != -1) {
inotify_config_wd = inotify_add_watch(inotify_fd,
current_config,
IN_MODIFY);
}
- if (inotify_fd && inotify_config_wd) {
+ if (inotify_fd != -1 && inotify_config_wd != -1) {
int len = 0, idx = 0;
fd_set descriptors;
struct timeval time_to_wait;
}
#ifdef HAVE_SYS_INOTIFY_H
- if (inotify_fd) {
+ if (inotify_fd != -1) {
inotify_rm_watch(inotify_fd, inotify_config_wd);
close(inotify_fd);
inotify_fd = inotify_config_wd = 0;
ERR("llua_load: %s", lua_tostring(lua_L, -1));
lua_pop(lua_L, 1);
#ifdef HAVE_SYS_INOTIFY_H
- } else if (!llua_block_notify && inotify_fd) {
+ } else if (!llua_block_notify && inotify_fd != -1) {
llua_append_notify(script);
#endif /* HAVE_SYS_INOTIFY_H */
}