diff --git a/inotify.c b/inotify.c index a77473d..7257fa4 100644 --- a/inotify.c +++ b/inotify.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #ifdef HAVE_INOTIFY_H #include #else @@ -534,7 +536,10 @@ start_inotify() int length, i = 0; char * esc_name = NULL; char * path_buf = NULL; - + + if (setpriority(PRIO_PROCESS, 0, 15) == -1) + DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce inotify thread priority\n"); + fd = inotify_init(); if ( fd < 0 ) { diff --git a/scanner.c b/scanner.c index db5646e..de84281 100644 --- a/scanner.c +++ b/scanner.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include @@ -782,6 +784,9 @@ start_scanner() { struct media_dir_s * media_path = media_dirs; + if (setpriority(PRIO_PROCESS, 0, 15) == -1) + DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce scanner thread priority\n"); + scanning = 1; freopen("/dev/null", "a", stderr); while( media_path )