inotify: Recognize new hard links.
Based on SF patch #139 (Thanks Alenky Klaus).
This commit is contained in:
parent
8e201fec7b
commit
5a309fc48f
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user