summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2023-03-17 14:36:26 +0200
committerPanu Matilainen <pmatilai@redhat.com>2023-03-17 14:36:26 +0200
commit8be31c77806604cdca3cf628fb087bc1cc3d5c9e (patch)
tree402ab65c5b03ad4eb33157de64bcf277eb1c3603 /lib
parentb960c0b43a080287a7c13533eeb2d9f288db1414 (diff)
downloadrpm-8be31c77806604cdca3cf628fb087bc1cc3d5c9e.tar.gz
Move variable to nearest available scope
Commit b960c0b43a080287a7c13533eeb2d9f288db1414 moved mayopen all the way to the function scope when the local if scope would've been enough. In a function with complex loops and all, nothing good comes out of having variables at unnecessarily wide scope.
Diffstat (limited to 'lib')
-rw-r--r--lib/fsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 183293edb..747ed2b09 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -879,7 +879,6 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
int firstlinkfile = -1;
- int mayopen = 0;
char *tid = NULL;
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
struct filedata_s *firstlink = NULL;
@@ -940,6 +939,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
fp = firstlink;
if (!fp->skip) {
+ int mayopen = 0;
int fd = -1;
rc = ensureDir(plugins, rpmfiDN(fi), 0,
(fp->action == FA_CREATE), 0, &di.dirfd);