$NetBSD: patch-bj,v 1.2 2007/12/29 16:15:55 joerg Exp $

--- src/file_convert.c.orig	2007-12-18 04:37:43.000000000 +0000
+++ src/file_convert.c
@@ -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 */
+#ifdef __DragonFly__
+	conv->max_threads_num = 1;
+#else
 	conv->max_threads_num = sysconf (_SC_NPROCESSORS_ONLN);
+#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);
