diff options
Diffstat (limited to 'mpiosh/config.c')
-rw-r--r-- | mpiosh/config.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/mpiosh/config.c b/mpiosh/config.c index e962266..931f785 100644 --- a/mpiosh/config.c +++ b/mpiosh/config.c @@ -2,7 +2,7 @@ * * Author: Andreas Buesching <crunchy@tzi.de> * - * $Id: config.c,v 1.6 2003/06/27 12:21:21 crunchy Exp $ + * $Id: config.c,v 1.7 2003/06/27 13:40:23 crunchy Exp $ * * Copyright (C) 2001 Andreas Büsching <crunchy@tzi.de> * @@ -166,23 +166,22 @@ mpiosh_config_read(struct mpiosh_config_t *config) return 1; } -int +char * mpiosh_config_check_backup_dir( struct mpiosh_config_t *config, int create ) { DIR *dir; char *path = cfg_resolve_path( CONFIG_BACKUP ); - int ret = 1; + char *ret = path; if ( ( dir = opendir( path ) ) == NULL ) - if ( create ) - ret = ( ! mkdir(path, 0777 ) ); - else - ret = 0; + if ( create ) { + if ( mkdir(path, 0777 ) ) + ret = NULL; + } else + ret = NULL; else closedir(dir); - free(path); - return ret; } |