mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk gtk) minor tweak: replace mkdir_p() with gtr_mkdir_with_parents() for symmetry with glib
This commit is contained in:
parent
d7e837c814
commit
450cfb74af
4 changed files with 9 additions and 10 deletions
|
@ -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 )
|
||||
|
|
|
@ -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( ) );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue