]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) minor tweak: replace mkdir_p() with gtr_mkdir_with_parents() for symmetry...
authorCharles Kerr <charles@transmissionbt.com>
Wed, 22 Jul 2009 20:39:12 +0000 (20:39 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 22 Jul 2009 20:39:12 +0000 (20:39 +0000)
gtk/conf.c
gtk/main.c
gtk/util.c
gtk/util.h

index b458c9c9a3641d7df94ccfa19148b6243fe03ea9..cf1cb6e496f4911e2853066c9adc9b8a0a42d06a 100644 (file)
@@ -57,7 +57,7 @@ cf_init( const char   * configDir,
 
     gl_confdir = g_strdup( configDir );
 
-    if( mkdir_p( gl_confdir, 0755 ) )
+    if( gtr_mkdir_with_parents( gl_confdir, 0755 ) )
         return TRUE;
 
     if( errstr != NULL )
index d427d0cad8c7c66a056b30abe0db04986a6b067a..a4664dd93e924acca42077f475003601836b3181 100644 (file)
@@ -438,9 +438,9 @@ main( int     argc,
 
         /* ensure the directories are created */
        if(( str = pref_string_get( PREF_KEY_DIR_WATCH )))
-           mkdir_p( str, 0777 );
+           gtr_mkdir_with_parents( str, 0777 );
        if(( str = pref_string_get( TR_PREFS_KEY_DOWNLOAD_DIR )))
-           mkdir_p( str, 0777 );
+           gtr_mkdir_with_parents( str, 0777 );
 
         /* initialize the libtransmission session */
         session = tr_sessionInit( "gtk", configDir, TRUE, pref_get_all( ) );
index 6dd2ab31b2821ec73ef2908c7e4c7bb223d6b89e..bc8744a66e11dd2224eafef88d5b6f011d8648e9 100644 (file)
@@ -7,7 +7,7 @@
  * This exemption does not extend to derived works not owned by
  * the Transmission project.
  *
- * $Id:$
+ * $Id$
  */
 
 #include <ctype.h> /* isxdigit() */
@@ -197,8 +197,7 @@ gtr_localtime2( char * buf, time_t time, size_t buflen )
 }
 
 int
-mkdir_p( const char * path,
-         mode_t       mode )
+gtr_mkdir_with_parents( const char * path, int mode )
 {
 #if GLIB_CHECK_VERSION( 2, 8, 0 )
     return !g_mkdir_with_parents( path, mode );
index 8a6e0c7581b6cdff027b27d1449b47347754ed6d..b7c8f1302f324b5abb2e7211e36d3bd359f1fb60 100644 (file)
@@ -7,7 +7,7 @@
  * This exemption does not extend to derived works not owned by
  * the Transmission project.
  *
- * $Id:$
+ * $Id$
  */
 
 #ifndef GTR_UTIL_H
@@ -38,9 +38,6 @@ char* gtr_localtime( time_t time );
 /* similar to asctime, but is utf8-clean */
 char* gtr_localtime2( char * buf, time_t time, size_t buflen );
 
-/* create a directory and any missing parent directories */
-int mkdir_p( const char *name, mode_t mode );
-
 /***
 ****
 ***/
@@ -79,6 +76,9 @@ char*       gtr_get_help_url( void );
 /* GTK-related utilities */
 #ifdef GTK_MAJOR_VERSION
 
+/* backwards-compatible wrapper around g_mkdir_with_parents() */
+int gtr_mkdir_with_parents( const char *name, int mode );
+
 /* backwards-compatible wrapper around gdk_threads_add_timeout_seconds() */
 guint gtr_timeout_add_seconds( guint seconds, GSourceFunc func, gpointer data );