1 --- minidlna-1.3.3/monitor.c.orig
2 +++ minidlna-1.3.3/monitor.c
4 char path_buf[PATH_MAX];
5 enum file_types type = TYPE_UNKNOWN;
9 if( access(path, R_OK|X_OK) != 0 )
13 esc_name = escape_tag(e->d_name, 1);
14 snprintf(path_buf, sizeof(path_buf), "%s/%s", path, e->d_name);
16 + if ((stat(path_buf, &st) == 0) &&
17 + (S_ISDIR(st.st_mode)||S_ISREG(st.st_mode)||S_ISLNK(st.st_mode)))
23 - type = resolve_unknown_type(path_buf, dir_types);
27 - if( type == TYPE_DIR )
29 - monitor_insert_directory(fd, esc_name, path_buf);
31 - else if( type == TYPE_FILE && check_notsparse(path_buf)) {
32 - monitor_insert_file(esc_name, path_buf);
33 + type = resolve_unknown_type(path_buf, dir_types);
34 + if( type == TYPE_DIR )
36 + monitor_insert_directory(fd, esc_name, path_buf);
38 + else if( type == TYPE_FILE )
40 + if(st.st_blocks<<9 >= st.st_size)
42 + monitor_insert_file(esc_name, path_buf);