From: Christophe F. <te...@gn...> - 2007-11-15 19:33:27
|
Hi, I started to push the code changes from your patch_winmac to http://gitweb.freedesktop.org/?p=users/teuf/libgpod.git;a=shortlog;h=portability I didn't look at all at the changes in the build system, I only looked at the changes in existing code. I hope I didn't miss anything while picking those changes. I reworked most of the changes though to make them more generic. I had a few questions though: > +#ifndef WIN32 > fd = creat (cts->filename, S_IRWXU|S_IRWXG|S_IRWXO); > +#else /* WIN32 */ > + chmod(cts->filename, S_IRWXU|S_IRWXG|S_IRWXO); > + fd = creat (cts->filename, 0); Is there any reason for that chmod before creating the file ? Will the file creation fail if there is an existing read-only file with the same name ? > /* shuffle uses forward slash separator, not colon */ > - path = g_strdup (tr->ipod_path); > - itdb_filename_ipod2fs (path); > - path_utf16 = g_utf8_to_utf16 (path, -1, NULL, &pathlen, NULL); > - if (pathlen > 261) pathlen = 261; > - fixup_little_utf16 (path_utf16); > - put_data (cts, (gchar *)path_utf16, sizeof (gunichar2)*pathlen); > + if (tr->ipod_path) > + { > + path = g_strdup (tr->ipod_path); > + itdb_filename_ipod2shuffle (path); > + path_utf16 = g_utf8_to_utf16 (path, -1, NULL, &pathlen, NULL); > + if (pathlen > 261) pathlen = 261; > + fixup_little_utf16 (path_utf16); > + put_data (cts, (gchar *)path_utf16, 2*pathlen); > + g_free(path); > + g_free(path_utf16); > + } Can you remember why you added the if (tr->ipod_path) check ? Did it happen to some of your users, or are you just being careful ? Thanks, Christophe |