diff options
author | Matthias Janssen <tisi95@users.sourceforce.net> | 2010-11-29 23:50:46 +0300 |
---|---|---|
committer | Carl Fürstenberg <azatoth@gmail.com> | 2011-03-29 02:59:39 +0400 |
commit | 633da6fd8df682f221f18b7a525667f0fe2b7ce1 (patch) | |
tree | 5f2e1906b3c2aa4c2f0825409ad108105cd238ce | |
parent | eb024683b54aef0fd711a8edda80262ef01dc6b6 (diff) |
Insert new symlinks recognized by ionotifypatch-tisi95_symlinks
This patch enables minidlna to insert new symbolic links when recognized by ionotify.
This feature is useful if you use mythlink or some other script that creates symlinks in minidlna's folder.
-rw-r--r-- | inotify.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -725,6 +725,15 @@ start_inotify() } } } + /* Insert new or moved symlinks (e.g. the symlinks created by mythlink) */ + else if ( event->mask & IN_CREATE || event->mask & IN_MOVED_TO ) + { + if( stat(path_buf, &st) == 0 && ((st.st_mode & S_IFMT) & S_IFLNK) ) + { + DPRINTF(E_DEBUG, L_INOTIFY, "The symbolic link %s was %s.\n", path_buf, (event->mask & IN_MOVED_TO ? "moved here" : "created")); + inotify_insert_file(esc_name, path_buf); + } + } else if ( event->mask & (IN_DELETE|IN_MOVED_FROM) ) { DPRINTF(E_DEBUG, L_INOTIFY, "The %s %s was %s.\n", |