commit d9e13d583db228dc189463a1468d3d75b9eb287e
Author: Christophe Fergeau <[email protected]>
Date: Tue Feb 9 12:10:05 2010 +0100
win32 portability fixes
src/db-artwork-writer.c | 1 -
src/itdb_itunesdb.c | 17 +++++++++++------
src/ithumb-writer.c | 4 ++--
3 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/db-artwork-writer.c b/src/db-artwork-writer.c
index b818dca..c19f481 100644
--- a/src/db-artwork-writer.c
+++ b/src/db-artwork-writer.c
@@ -44,7 +44,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <sys/mman.h>
#include <sys/stat.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 2d65d11..46a5ade 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -381,6 +381,12 @@ static void fcontents_free (FContents *cts)
}
}
+static void itdb_sync (void)
+{
+#ifndef WIN32
+ sync();
+#endif
+}
/* There seems to be a problem with some distributions (kernel
versions or whatever -- even identical version numbers don't don't
@@ -5758,7 +5764,7 @@ err:
/* make sure all buffers are flushed as some people tend to
disconnect as soon as gtkpod returns */
- sync ();
+ itdb_sync ();
return result;
}
@@ -5864,7 +5870,7 @@ gboolean itdb_write (Itdb_iTunesDB *itdb, GError **error)
/* make sure all buffers are flushed as some people tend to
disconnect as soon as gtkpod returns */
- sync ();
+ itdb_sync ();
#ifdef HAVE_LIBIMOBILEDEVICE
if (itdb_device_is_iphone_family (itdb->device)) {
@@ -6032,7 +6038,7 @@ gboolean itdb_shuffle_write (Itdb_iTunesDB *itdb, GError
**error)
/* make sure all buffers are flushed as some people tend to
disconnect as soon as gtkpod returns */
- sync ();
+ itdb_sync ();
return result;
}
@@ -6161,7 +6167,7 @@ gboolean itdb_shuffle_write_file (Itdb_iTunesDB *itdb,
/* make sure all buffers are flushed as some people tend to
disconnect as soon as gtkpod returns */
- sync ();
+ itdb_sync ();
return result;
}
@@ -6846,8 +6852,7 @@ gboolean itdb_cp (const gchar *from_file, const gchar
*to_file,
goto err_out;
}
- file_out = g_open (to_file, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY,
- S_IRWXU|S_IRWXG|S_IRWXO);
+ file_out = g_open (to_file, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 0777);
if (file_out < 0)
{
g_set_error (error,
diff --git a/src/ithumb-writer.c b/src/ithumb-writer.c
index 9246978..46087e8 100644
--- a/src/ithumb-writer.c
+++ b/src/ithumb-writer.c
@@ -1124,7 +1124,7 @@ static gchar *ithumb_get_artwork_dir (const char
*mount_point)
return NULL;
}
dir = g_build_filename (control_dir, "Artwork", NULL);
- mkdir (dir, 0777);
+ g_mkdir (dir, 0777);
g_free (dir);
g_free (control_dir);
@@ -1149,7 +1149,7 @@ static gchar *ithumb_get_photos_thumb_dir(const char
*mount_point)
return NULL;
}
dir = g_build_filename (photos_dir, "Thumbs", NULL);
- mkdir (dir, 0777);
+ g_mkdir (dir, 0777);
g_free (dir);
g_free (photos_dir);
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2