diff --git a/inotify.c b/inotify.c index 8e34347..745436c 100644 --- a/inotify.c +++ b/inotify.c @@ -716,9 +716,10 @@ start_inotify() else if ( (event->mask & (IN_CLOSE_WRITE|IN_MOVED_TO|IN_CREATE)) && (lstat(path_buf, &st) == 0) ) { - if( S_ISLNK(st.st_mode) ) + if( (event->mask & (IN_MOVED_TO|IN_CREATE)) && (S_ISLNK(st.st_mode) || st.st_nlink > 1) ) { - DPRINTF(E_DEBUG, L_INOTIFY, "The symbolic link %s was %s.\n", + DPRINTF(E_DEBUG, L_INOTIFY, "The %s link %s was %s.\n", + (S_ISLNK(st.st_mode) ? "symbolic" : "hard"), path_buf, (event->mask & IN_MOVED_TO ? "moved here" : "created")); if( stat(path_buf, &st) == 0 && S_ISDIR(st.st_mode) ) inotify_insert_directory(pollfds[0].fd, esc_name, path_buf);