 +BF_PYTHON_BINARY = BF_PYTHON + '/bin/python' + BF_PYTHON_VERSION
 +BF_PYTHON_LIB = 'python' + BF_PYTHON_VERSION
 +BF_PYTHON_LIBPATH = HAIKU_COMMON_LIB
-+BF_PYTHON_LINKFLAGS = os.popen("python-config' + BF_PYTHON_VERSION + ' --ldflags").readline()
++pipe = subprocess.Popen(['python' + BF_PYTHON_VERSION + '-config', '--ldflags'], stdout=subprocess.PIPE)
++BF_PYTHON_LINKFLAGS = pipe.communicate()[0]
++pipe.stdout.close()
 +
 +WITH_BF_OPENAL = 'false' # TODO
 +#BF_OPENAL = '/usr'

+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS = '-g'
+
+BF_BUILDDIR = '../build-haiku1'
+BF_INSTALLDIR='../install-haiku1'
+

+		fGSystem->pushEvent(event);
+	}
+}
Index: source/blender/imbuf/intern/imbuf.h
===================================================================
--- source/blender/imbuf/intern/imbuf.h	(revision 19951)
+++ source/blender/imbuf/intern/imbuf.h	(working copy)
@@ -51,7 +51,7 @@
 #include <sys/mman.h>
 #endif
 
-#if !defined(WIN32) && !defined(__BeOS)
+#if !defined(WIN32) && !defined(__BeOS) && !defined(__HAIKU__)
 #define O_BINARY 0
 #endif
 
Index: source/blender/blenlib/intern/storage.c
===================================================================
--- source/blender/blenlib/intern/storage.c	(revision 19951)
