summaryrefslogtreecommitdiff
path: root/audio/gtkpod/patches/patch-bj
blob: 90f0bf254f9987ab35669d17cb2385c5252d867d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-bj,v 1.3 2008/01/06 17:04:14 rillig Exp $

--- src/file_convert.c.orig	2007-12-18 04:37:43.000000000 +0000
+++ src/file_convert.c	2008-01-06 18:00:56.000000000 +0000
@@ -216,7 +216,7 @@ struct _ConvTrack
     gchar *fname_root;      /* filename root of converted file          */
     gchar *fname_extension; /* filename extension of converted file     */
     GPid  pid;              /* PID of child doing the conversion        */
-    gint  stderr;           /* stderr of child doing the conversion     */
+    gint  Cstderr;          /* stderr of child doing the conversion     */
     Track *track;           /* for reference, don't access inside threads! */
     iTunesDB *itdb;         /* for reference, don't access inside threads! */
     gint  threadnum;        /* number of thread working on this track   */
@@ -647,7 +647,11 @@ static void conversion_prefs_changed (Co
     conv->max_threads_num = prefs_get_int (FILE_CONVERT_MAX_THREADS_NUM);
     if (conv->max_threads_num == 0)
     {   /* set to maximum available number of processors */
+#if defined(_SC_NPROCESSORS_ONLN) && !defined(__DragonFly__)
 	conv->max_threads_num = sysconf (_SC_NPROCESSORS_ONLN);
+#else
+	conv->max_threads_num = 1;
+#endif
 	/* paranoia mode on */
 	if (conv->max_threads_num <= 0)
 	{
@@ -2308,7 +2312,7 @@ static gboolean conversion_convert_track
 				  &ctr->pid,    /* child's PID    */
 				  NULL,         /* child's stdin  */
 				  NULL,         /* child's stdout */
-				  &ctr->stderr, /* child's stderr */
+				  &ctr->Cstderr,/* child's stderr */
 				  &error);
 
 	    child_pid = ctr->pid;
@@ -2334,7 +2338,7 @@ static gboolean conversion_convert_track
 		gint status;
 
 		/* set up i/o channel to main thread */
-		ctr->gio_channel = g_io_channel_unix_new (ctr->stderr);
+		ctr->gio_channel = g_io_channel_unix_new (ctr->Cstderr);
 		g_io_channel_set_flags (ctr->gio_channel,
 					G_IO_FLAG_NONBLOCK, NULL);
 		g_io_channel_set_close_on_unref (ctr->gio_channel, TRUE);