commit 68ca73c13f0ed5531d554d7105c69b242afe4683
Author: Christophe Fergeau <[email protected]>
Date: Tue Jun 15 22:09:13 2010 +0200
fix creation of Device directory for Shuffles
The previous code wasn't taking into account that itdb_get_device_dir
returns NULL when the dir doesn't exist and thus can't be used to
create the directory when it's absent.
tools/generic-callout.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/tools/generic-callout.c b/tools/generic-callout.c
index 429bf78..873a158 100644
--- a/tools/generic-callout.c
+++ b/tools/generic-callout.c
@@ -603,7 +603,17 @@ static gboolean write_sysinfo_extended (const char
*mountpoint,
devdirpath = itdb_get_device_dir (mountpoint);
/* Make sure the device dir exists (not necessarily true on
* Shuffles */
- g_mkdir (devdirpath, 0777);
+ if (devdirpath == NULL) {
+ gchar *itunesdirpath;
+
+ itunesdirpath = itdb_get_itunes_dir (mountpoint);
+ if (itunesdirpath == NULL) {
+ return FALSE;
+ }
+ devdirpath = g_build_filename (itunesdirpath, "Device", NULL);
+ g_free (itunesdirpath);
+ g_mkdir (devdirpath, 0777);
+ }
filename = g_build_filename (devdirpath, "SysInfoExtended", NULL);
g_free (devdirpath);
if (filename == NULL) {
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2