]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove the dead {d,log,rt}path variables in libxfs_init
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Dec 2023 16:37:21 +0000 (17:37 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 18 Dec 2023 13:57:48 +0000 (14:57 +0100)
These variables are only initialized, and then unlink is called if they
were changed from the initial value, which can't happen.  Remove the
variables and the conditional unlink calls.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/init.c

index ce6e62cde9449002785fa9c23f928954a4926bf0..a8603e2fb330656d6a47ba475e4a126573c5a153 100644 (file)
@@ -307,17 +307,13 @@ libxfs_init(libxfs_init_t *a)
 {
        char            *blockfile;
        char            *dname;
-       char            dpath[25];
        int             fd;
        char            *logname;
-       char            logpath[25];
        char            *rawfile;
        char            *rtname;
-       char            rtpath[25];
        int             rval = 0;
        int             flags;
 
-       dpath[0] = logpath[0] = rtpath[0] = '\0';
        dname = a->dname;
        logname = a->logname;
        rtname = a->rtname;
@@ -418,12 +414,6 @@ libxfs_init(libxfs_init_t *a)
        init_caches();
        rval = 1;
 done:
-       if (dpath[0])
-               unlink(dpath);
-       if (logpath[0])
-               unlink(logpath);
-       if (rtpath[0])
-               unlink(rtpath);
        if (fd >= 0)
                close(fd);
        if (!rval) {