From 13305e4937dd1d48b8e11c03288f1f170d4c8d7d Mon Sep 17 00:00:00 2001 From: smitsohu Date: Sun, 29 Sep 2019 19:26:29 +0200 Subject: improve variable names --- src/firejail/chroot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/firejail/chroot.c b/src/firejail/chroot.c index c99af1d52..4eff84494 100644 --- a/src/firejail/chroot.c +++ b/src/firejail/chroot.c @@ -141,14 +141,14 @@ static void copy_resolvconf(int parentfd) { fwarning("/etc/resolv.conf not initialized\n"); return; } - struct stat instat; - if (fstat(in, &instat) == -1) + struct stat src; + if (fstat(in, &src) == -1) errExit("fstat"); // try to detect if resolv.conf has been bind mounted into the chroot // do nothing in this case in order to not truncate the real file - struct stat outstat; - if (fstatat(parentfd, "etc/resolv.conf", &outstat, 0) == 0) { - if (instat.st_dev == outstat.st_dev && instat.st_ino == outstat.st_ino) { + struct stat dst; + if (fstatat(parentfd, "etc/resolv.conf", &dst, 0) == 0) { + if (src.st_dev == dst.st_dev && src.st_ino == dst.st_ino) { close(in); return; } @@ -158,7 +158,7 @@ static void copy_resolvconf(int parentfd) { int out = openat(parentfd, "etc/resolv.conf", O_CREAT|O_WRONLY|O_TRUNC|O_CLOEXEC, S_IRUSR | S_IWRITE | S_IRGRP | S_IROTH); if (out == -1) errExit("open"); - if (sendfile(out, in, NULL, instat.st_size) == -1) + if (sendfile(out, in, NULL, src.st_size) == -1) errExit("sendfile"); close(in); close(out); -- cgit v1.2.3-70-g09d2