From b5f5847bedf884611a9978236bb66d150016c71e Mon Sep 17 00:00:00 2001 From: crunchy Date: Fri, 27 Jun 2003 13:40:23 +0000 Subject: tested and hopefully fixed the backup and restore commands --- mpiosh/config.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'mpiosh/config.c') 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 * - * $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 * @@ -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; } -- cgit v1.2.3