1
1

opal/compress: remove misc dead code

as reported by Coverity with CIDs 71856,
1269714, 1269715, 1269717, 1269718, 1269723, 1269724
Этот коммит содержится в:
Gilles Gouaillardet 2015-03-06 15:34:08 +09:00
родитель 5b41de4886
Коммит da90ed4483
4 изменённых файлов: 16 добавлений и 37 удалений

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

@ -1,6 +1,8 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
*
@ -47,7 +49,6 @@
int opal_compress_base_tar_create(char ** target)
{
int exit_status = OPAL_SUCCESS;
char *cmd = NULL;
char *tar_target = NULL;
char **argv = NULL;
pid_t child_pid = 0;
@ -57,6 +58,7 @@ int opal_compress_base_tar_create(char ** target)
child_pid = fork();
if( 0 == child_pid ) { /* Child */
char *cmd;
asprintf(&cmd, "tar -cf %s %s", tar_target, *target);
argv = opal_argv_split(cmd, ' ');
@ -82,13 +84,8 @@ int opal_compress_base_tar_create(char ** target)
}
cleanup:
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
if( NULL != tar_target ) {
free(tar_target);
tar_target = NULL;
}
return exit_status;
@ -97,13 +94,13 @@ int opal_compress_base_tar_create(char ** target)
int opal_compress_base_tar_extract(char ** target)
{
int exit_status = OPAL_SUCCESS;
char *cmd = NULL;
char **argv = NULL;
pid_t child_pid = 0;
int status = 0;
child_pid = fork();
if( 0 == child_pid ) { /* Child */
char *cmd;
asprintf(&cmd, "tar -xf %s", *target);
argv = opal_argv_split(cmd, ' ');
@ -129,10 +126,6 @@ int opal_compress_base_tar_extract(char ** target)
}
cleanup:
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
return exit_status;
}

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

@ -1,6 +1,8 @@
/*
* Copyright (c) 2004-2010 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
*
* $COPYRIGHT$
*
@ -49,14 +51,14 @@ int opal_compress_base_select(void)
/* Save the winner */
opal_compress_base_selected_component = *best_component;
opal_compress = *best_module;
/* Initialize the winner */
if (NULL != best_module) {
if (OPAL_SUCCESS != (ret = opal_compress.init()) ) {
if (OPAL_SUCCESS != (ret = best_module->init()) ) {
exit_status = ret;
goto cleanup;
}
opal_compress = *best_module;
}
cleanup:

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

@ -4,6 +4,8 @@
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
*
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -68,7 +70,6 @@ int opal_compress_bzip_compress(char * fname, char **cname, char **postfix)
int opal_compress_bzip_compress_nb(char * fname, char **cname, char **postfix, pid_t *child_pid)
{
char * cmd = NULL;
char **argv = NULL;
char * base_fname = NULL;
char * dir_fname = NULL;
@ -79,6 +80,7 @@ int opal_compress_bzip_compress_nb(char * fname, char **cname, char **postfix, p
*child_pid = fork();
if( *child_pid == 0 ) { /* Child */
char * cmd;
dir_fname = opal_dirname(fname);
base_fname = opal_basename(fname);
@ -124,11 +126,6 @@ int opal_compress_bzip_compress_nb(char * fname, char **cname, char **postfix, p
return OPAL_ERROR;
}
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
return OPAL_SUCCESS;
}
@ -153,7 +150,6 @@ int opal_compress_bzip_decompress(char * cname, char **fname)
int opal_compress_bzip_decompress_nb(char * cname, char **fname, pid_t *child_pid)
{
char * cmd = NULL;
char **argv = NULL;
char * dir_cname = NULL;
pid_t loc_pid = 0;
@ -184,6 +180,7 @@ int opal_compress_bzip_decompress_nb(char * cname, char **fname, pid_t *child_pi
/* Fork(bunzip) */
loc_pid = fork();
if( loc_pid == 0 ) { /* Child */
char * cmd;
asprintf(&cmd, "bunzip2 %s", cname);
opal_output_verbose(10, mca_compress_bzip_component.super.output_handle,
@ -224,11 +221,6 @@ int opal_compress_bzip_decompress_nb(char * cname, char **fname, pid_t *child_pi
return OPAL_ERROR;
}
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
return OPAL_SUCCESS;
}

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

@ -4,6 +4,8 @@
* Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
*
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -68,7 +70,6 @@ int opal_compress_gzip_compress(char * fname, char **cname, char **postfix)
int opal_compress_gzip_compress_nb(char * fname, char **cname, char **postfix, pid_t *child_pid)
{
char * cmd = NULL;
char **argv = NULL;
char * base_fname = NULL;
char * dir_fname = NULL;
@ -79,6 +80,7 @@ int opal_compress_gzip_compress_nb(char * fname, char **cname, char **postfix, p
*child_pid = fork();
if( *child_pid == 0 ) { /* Child */
char * cmd = NULL;
dir_fname = opal_dirname(fname);
base_fname = opal_basename(fname);
@ -125,11 +127,6 @@ int opal_compress_gzip_compress_nb(char * fname, char **cname, char **postfix, p
return OPAL_ERROR;
}
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
return OPAL_SUCCESS;
}
@ -154,7 +151,6 @@ int opal_compress_gzip_decompress(char * cname, char **fname)
int opal_compress_gzip_decompress_nb(char * cname, char **fname, pid_t *child_pid)
{
char * cmd = NULL;
char **argv = NULL;
char * dir_cname = NULL;
pid_t loc_pid = 0;
@ -180,6 +176,7 @@ int opal_compress_gzip_decompress_nb(char * cname, char **fname, pid_t *child_pi
*child_pid = fork();
if( *child_pid == 0 ) { /* Child */
char * cmd;
dir_cname = opal_dirname(cname);
chdir(dir_cname);
@ -227,11 +224,6 @@ int opal_compress_gzip_decompress_nb(char * cname, char **fname, pid_t *child_pi
return OPAL_ERROR;
}
if( NULL != cmd ) {
free(cmd);
cmd = NULL;
}
return OPAL_SUCCESS;
}