From 6cd0b4ad820a64be84944be49d8848d537d823c9 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 29 Apr 2018 17:23:23 +0200
Subject: Haiku doesn't have setpriority nor d_type


diff --git a/monitor.c b/monitor.c
index b3a17f5..a4cf7a2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -533,6 +533,7 @@ monitor_insert_directory(int fd, char *name, const char * path)
 			continue;
 		esc_name = escape_tag(e->d_name, 1);
 		snprintf(path_buf, sizeof(path_buf), "%s/%s", path, e->d_name);
+		#ifndef __HAIKU__
 		switch( e->d_type )
 		{
 			case DT_DIR:
@@ -543,6 +544,9 @@ monitor_insert_directory(int fd, char *name, const char * path)
 			default:
 				break;
 		}
+		#else
+		type = resolve_unknown_type(path_buf, dir_types);
+		#endif
 		if( type == TYPE_DIR )
 		{
 			monitor_insert_directory(fd, esc_name, path_buf);
diff --git a/scanner.c b/scanner.c
index a730567..2c2ad43 100644
--- a/scanner.c
+++ b/scanner.c
@@ -897,7 +897,9 @@ start_scanner(void)
 	struct media_dir_s *media_path;
 	char path[MAXPATHLEN];
 
+	#ifndef __HAIKU__
 	if (setpriority(PRIO_PROCESS, 0, 15) == -1)
+	#endif
 		DPRINTF(E_WARN, L_INOTIFY,  "Failed to reduce scanner thread priority\n");
 
 	setlocale(LC_COLLATE, "");
diff --git a/upnphttp.c b/upnphttp.c
index 3b4b58a..3381863 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -1760,10 +1760,12 @@ SendResp_resizedimg(struct upnphttp * h, char * object)
 
 	INIT_STR(str, header);
 
+#ifndef __HAIKU__
 #if USE_FORK
 	if( (h->reqflags & FLAG_XFERBACKGROUND) && (setpriority(PRIO_PROCESS, 0, 19) == 0) )
 		tmode = "Background";
 	else
+#endif
 #endif
 		tmode = "Interactive";
 	start_dlna_header(&str, 200, tmode, "image/jpeg");
@@ -1980,10 +1982,12 @@ SendResp_dlnafile(struct upnphttp *h, char *object)
 
 	INIT_STR(str, header);
 
+#ifndef __HAIKU__
 #if USE_FORK
 	if( (h->reqflags & FLAG_XFERBACKGROUND) && (setpriority(PRIO_PROCESS, 0, 19) == 0) )
 		tmode = "Background";
 	else
+#endif
 #endif
 	if( strncmp(last_file.mime, "image", 5) == 0 )
 		tmode = "Interactive";
-- 
2.16.4


From f28a08d22ba34e6286cc543e21a7f59e78daf793 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 24 Jun 2018 07:06:37 +0200
Subject: set correct path for the conf file


diff --git a/minidlna.c b/minidlna.c
index 10b4806..2d95bfa 100644
--- a/minidlna.c
+++ b/minidlna.c
@@ -499,7 +499,7 @@ init(int argc, char **argv)
 	int options_flag = 0;
 	struct sigaction sa;
 	const char * presurl = NULL;
-	const char * optionsfile = "/etc/minidlna.conf";
+	const char * optionsfile = "/system/settings/minidlna.conf";
 	char mac_str[13];
 	char *string, *word;
 	char *path;
-- 
2.16.4

