From: Christoph Hellwig Date: Mon, 11 Dec 2023 16:37:21 +0000 (+0100) Subject: libxfs: remove the dead {d,log,rt}path variables in libxfs_init X-Git-Tag: v6.6.0~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74c77adf5d377dc0fdbb32d6c40f1d17724fc044;p=thirdparty%2Fxfsprogs-dev.git libxfs: remove the dead {d,log,rt}path variables in libxfs_init 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 Reviewed-by: Darrick J. Wong Reviewed-by: Carlos Maiolino Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/init.c b/libxfs/init.c index ce6e62cde..a8603e2fb 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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) {