From ed3dbc1f35148b5c68007d4a85516251488ee95e Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Tue, 12 Jan 2010 18:50:04 +0100 Subject: [PATCH] Fill in the watch_info struct only when it's needed --- src/filescanner.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/filescanner.c b/src/filescanner.c index e083f972..a641a978 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -536,12 +536,14 @@ process_directory(int libidx, char *path, int flags) return; } - wi.libidx = libidx; - wi.cookie = 0; - wi.path = path; - if (!(flags & F_SCAN_RESCAN)) - db_watch_add(&wi); + { + wi.libidx = libidx; + wi.cookie = 0; + wi.path = path; + + db_watch_add(&wi); + } #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) memset(&kev, 0, sizeof(struct kevent));