Skip to content

Commit 9e6086c

Browse files
committed
code cleanups, fixing warnings
1 parent 6160db8 commit 9e6086c

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

src/gufi_dir2index.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
189189
nda.topath = NULL;
190190
nda.ed.type = 'd';
191191

192-
DIR *dir = NULL;
193-
194192
decompress_work(&nda.work, data);
195193

196194
const int process_dbdb = ((pa->in.min_level <= nda.work->level) &&
@@ -210,7 +208,6 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
210208
rc = 1;
211209
goto cleanup;
212210
}
213-
dir = dir_rc->dir;
214211

215212
/* offset by work->root_len to remove prefix */
216213
nda.topath_len = nda.in->nameto.len + 1 + nda.work->name_len - nda.work->root_parent.len;
@@ -235,7 +232,7 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
235232
if (err != EEXIST) {
236233
fprintf(stderr, "mkdir %s failure: %d %s\n", nda.topath, err, strerror(err));
237234
rc = 1;
238-
goto cleanup;
235+
goto cleanup_dir;
239236
}
240237
}
241238

@@ -250,7 +247,7 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
250247

251248
if (!nda.db) {
252249
rc = 1;
253-
goto cleanup;
250+
goto cleanup_dir;
254251
}
255252

256253
/* prepare to insert into the database */
@@ -315,9 +312,10 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
315312
chmod(nda.topath, nda.ed.statuso.st_mode);
316313
chown(nda.topath, nda.ed.statuso.st_uid, nda.ed.statuso.st_gid);
317314

318-
cleanup:
315+
cleanup_dir:
319316
dir_dec(dir_rc);
320317

318+
cleanup:
321319
if (process_dbdb) {
322320
pa->total_dirs[id]++;
323321
pa->total_nondirs[id] += ctrs.nondirs_processed;

src/gufi_dir2trace.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
141141
rc = 1;
142142
goto cleanup;
143143
}
144-
DIR *dir = dir_rc->dir;
145144

146145
memset(&ed, 0, sizeof(ed));
147146
if (lstat(work->name, &ed.statuso) != 0) {

src/gufi_index2dir.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ static int processdir(struct QPTPool * ctx, const size_t id, void * data, void *
271271
rc = 1;
272272
goto cleanup;
273273
}
274-
DIR *dir = dir_rc->dir;
275274

276275
// get source directory info
277276
struct stat dir_st;

src/gufi_treesummary.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ static int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
138138
if (!dir_rc) {
139139
goto out_free;
140140
}
141-
DIR *dir = dir_rc->dir;
142141

143142
if (pa->in.printdir) {
144143
ed.type = 'd';

src/parallel_cpr.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ static int cpr_dir(QPTPool_t *ctx, const size_t id, void *data, void *args) {
235235
if (!dir_rc) {
236236
print_error_and_goto("Could not open_directory", work->name, cleanup);
237237
}
238-
DIR *dir = dir_rc->dir;
239238

240239
struct stat st;
241240
if (lstat(work->name, &st) != 0) {

test/unit/googletest/descend.cpp.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ TEST(descend, builddir) {
182182
QPTPool_destroy(pool);
183183

184184
EXPECT_EQ(closedir(dir), 0);
185-
free(work);
185+
free_work(work);
186186
EXPECT_EQ(unlink(pipename), 0);
187187
EXPECT_EQ(unlink(linkname), 0);
188188
}
@@ -273,7 +273,7 @@ TEST(descend, swap) {
273273
QPTPool_destroy(pool);
274274

275275
EXPECT_EQ(closedir(dir), 0);
276-
free(work);
276+
free_work(work);
277277

278278
EXPECT_EQ(remove(root), 0);
279279
}

0 commit comments

Comments
 (0)