gst-plugins-ugly1: update to 1.24.10
[oi-userland.git] / components / encumbered / minidlna / patches / 03-monitor.c.patch
blobddd7e725601c55445ccac874be43c9ac579f70a5
1 --- minidlna-1.3.3/monitor.c.orig
2 +++ minidlna-1.3.3/monitor.c
3 @@ -298,6 +298,7 @@
4 char path_buf[PATH_MAX];
5 enum file_types type = TYPE_UNKNOWN;
6 media_types dir_types;
7 + struct stat st;
9 if( access(path, R_OK|X_OK) != 0 )
11 @@ -341,22 +342,21 @@
12 continue;
13 esc_name = escape_tag(e->d_name, 1);
14 snprintf(path_buf, sizeof(path_buf), "%s/%s", path, e->d_name);
15 - switch( e->d_type )
16 + if ((stat(path_buf, &st) == 0) &&
17 + (S_ISDIR(st.st_mode)||S_ISREG(st.st_mode)||S_ISLNK(st.st_mode)))
19 - case DT_DIR:
20 - case DT_REG:
21 - case DT_LNK:
22 - case DT_UNKNOWN:
23 - type = resolve_unknown_type(path_buf, dir_types);
24 - default:
25 - break;
26 - }
27 - if( type == TYPE_DIR )
28 - {
29 - monitor_insert_directory(fd, esc_name, path_buf);
30 - }
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 )
35 + {
36 + monitor_insert_directory(fd, esc_name, path_buf);
37 + }
38 + else if( type == TYPE_FILE )
39 + {
40 + if(st.st_blocks<<9 >= st.st_size)
41 + {
42 + monitor_insert_file(esc_name, path_buf);
43 + }
44 + }
46 free(esc_name);