Fill in the watch_info struct only when it's needed

This commit is contained in:
Julien BLACHE 2010-01-12 18:50:04 +01:00
parent 364b22c030
commit ed3dbc1f35

View File

@ -536,12 +536,14 @@ process_directory(int libidx, char *path, int flags)
return; return;
} }
if (!(flags & F_SCAN_RESCAN))
{
wi.libidx = libidx; wi.libidx = libidx;
wi.cookie = 0; wi.cookie = 0;
wi.path = path; wi.path = path;
if (!(flags & F_SCAN_RESCAN))
db_watch_add(&wi); db_watch_add(&wi);
}
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
memset(&kev, 0, sizeof(struct kevent)); memset(&kev, 0, sizeof(struct kevent));