libgfapi: Remove useless call to lstat

There's no need to lstat cmd_args->volfile, since we already
check to see if fopen fails. The error message was largely the
same.

BUG: 789278
CID: 1124869

Change-Id: I10827154b32c72d2e4a1ab0d3c1e464f8af6ffee
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-on: http://review.gluster.org/6783
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
This commit is contained in:
Jose A. Rivera 2014-01-24 10:00:02 -06:00 committed by Anand Avati
parent 8814fdafab
commit c0ac212223

View File

@ -214,20 +214,11 @@ err:
static FILE * static FILE *
get_volfp (struct glfs *fs) get_volfp (struct glfs *fs)
{ {
int ret = 0;
cmd_args_t *cmd_args = NULL; cmd_args_t *cmd_args = NULL;
FILE *specfp = NULL; FILE *specfp = NULL;
struct stat statbuf;
cmd_args = &fs->ctx->cmd_args; cmd_args = &fs->ctx->cmd_args;
ret = lstat (cmd_args->volfile, &statbuf);
if (ret == -1) {
gf_log ("glfs", GF_LOG_ERROR,
"%s: %s", cmd_args->volfile, strerror (errno));
return NULL;
}
if ((specfp = fopen (cmd_args->volfile, "r")) == NULL) { if ((specfp = fopen (cmd_args->volfile, "r")) == NULL) {
gf_log ("glfs", GF_LOG_ERROR, gf_log ("glfs", GF_LOG_ERROR,
"volume file %s: %s", "volume file %s: %s",