diff options
author | crunchy <crunchy> | 2003-06-27 13:40:23 +0000 |
---|---|---|
committer | crunchy <crunchy> | 2003-06-27 13:40:23 +0000 |
commit | b5f5847bedf884611a9978236bb66d150016c71e (patch) | |
tree | d14e220039dba60b90fd9f9909aff7a7cb20079d /mpiosh/config.c | |
parent | c6c22c4fadb3000453389f3ecf471392674adfd1 (diff) | |
download | mpiosh-b5f5847bedf884611a9978236bb66d150016c71e.tar.gz mpiosh-b5f5847bedf884611a9978236bb66d150016c71e.tar.bz2 mpiosh-b5f5847bedf884611a9978236bb66d150016c71e.zip |
tested and hopefully fixed the backup and restore commands
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; } |