gpperfmon: Fix coverity issue
CID 170478:  Control flow issues  (DEADCODE)
the "goto" function was dead code. We are closing the currently opened
file right before we open up a new file already, so the FILE pointer was
always NULL when "goto bail" occurred.
@@ -641,7 +641,6 @@ apr_status_t agg_dump(agg_t* agg)
apr_hash_index_t *hi;
bloom_t bloom;
char nowstr[GPMON_DATE_BUF_SIZE];
- int e = 0;
FILE* fp_queries_now = 0;
FILE* fp_queries_tail = 0;
@@ -690,10 +689,7 @@ apr_status_t agg_dump(agg_t* agg)
incremement_tail_bytes(temp_bytes_written);
if (! (fp_queries_tail = fopen(GPMON_DIR "queries_tail.dat", "a")))
- {
- e = APR_FROM_OS_ERROR(errno);
- goto bail;
- }
+ return APR_FROM_OS_ERROR(errno);
/* loop through queries */
for (hi = apr_hash_first(0, agg->qtab); hi; hi = apr_hash_next(hi))
@@ -743,10 +739,7 @@ apr_status_t agg_dump(agg_t* agg)
incremement_tail_bytes(temp_bytes_written);
if (! (fp_queries_now = fopen(GPMON_DIR "_queries_now.dat", "w")))
- {
- e = APR_FROM_OS_ERROR(errno);
- goto bail;
- }
+ return APR_FROM_OS_ERROR(errno);
for (hi = apr_hash_first(0, agg->qtab); hi; hi = apr_hash_next(hi))
{
@@ -791,11 +784,6 @@ apr_status_t agg_dump(agg_t* agg)
delete_old_files(&bloom);
return 0;
-
- bail:
- if (fp_queries_now) fclose(fp_queries_now);
- if (fp_queries_tail) fclose(fp_queries_tail);
- return e;
}
extern int gpmmon_quantum(void);
