Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Janssen <tisi95@users.sourceforce.net>2010-11-29 23:50:46 +0300
committerCarl Fürstenberg <azatoth@gmail.com>2011-03-29 02:59:39 +0400
commit633da6fd8df682f221f18b7a525667f0fe2b7ce1 (patch)
tree5f2e1906b3c2aa4c2f0825409ad108105cd238ce
parenteb024683b54aef0fd711a8edda80262ef01dc6b6 (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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/inotify.c b/inotify.c
index 7353940..c487d5d 100644
--- a/inotify.c
+++ b/inotify.c
@@ -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",