1
1
This commit was SVN r13057.
Этот коммит содержится в:
George Bosilca 2007-01-09 16:31:08 +00:00
родитель 624f139bd8
Коммит c9be97c089

Просмотреть файл

@ -164,7 +164,7 @@ int opal_os_dirpath_create(const char *path, const mode_t mode)
* try to recursively remove all directories. If provided, the * try to recursively remove all directories. If provided, the
* callback function is executed prior to the directory or file being * callback function is executed prior to the directory or file being
* removed. If the callback returns non-zero, then no removal is * removed. If the callback returns non-zero, then no removal is
* done. * done.
*/ */
int opal_os_dirpath_destroy(const char *path, int opal_os_dirpath_destroy(const char *path,
bool recursive, bool recursive,
@ -295,10 +295,7 @@ int opal_os_dirpath_destroy(const char *path,
} }
do { do {
/* /* Skip . and .. */
* Skip
* - . and ..
*/
if ((0 == strcmp(file_data.cFileName, ".")) || if ((0 == strcmp(file_data.cFileName, ".")) ||
(0 == strcmp(file_data.cFileName, "..")) ) { (0 == strcmp(file_data.cFileName, "..")) ) {
continue; continue;
@ -322,6 +319,10 @@ int opal_os_dirpath_destroy(const char *path,
/* Will the caller allow us to remove this file/directory */ /* Will the caller allow us to remove this file/directory */
if( NULL != cbfunc) { if( NULL != cbfunc) {
/*
* Caller does not wish to remove this file/directory,
* continue with the rest of the entries
*/
if( !cbfunc(path, file_data.cFileName) ) { if( !cbfunc(path, file_data.cFileName) ) {
continue; continue;
} }
@ -333,12 +334,14 @@ int opal_os_dirpath_destroy(const char *path,
recursive, recursive,
cbfunc) ) ) { cbfunc) ) ) {
exit_status = rc; exit_status = rc;
free(file_name);
goto cleanup; goto cleanup;
} }
} }
else { else {
DeleteFile(file_name); DeleteFile(file_name);
} }
free(file_name);
} while( 0 != FindNextFile(file, &file_data) ); } while( 0 != FindNextFile(file, &file_data) );
FindClose(file); FindClose(file);