Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2021 05:15:43 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 996c4186aa7b - stable/13 - makesyscalls: stop trying to remove . and .. in cleanup
Message-ID:  <202110030515.1935FhYf008805@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=996c4186aa7bd212dec8cd40829533c7e395bab6

commit 996c4186aa7bd212dec8cd40829533c7e395bab6
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2021-01-27 17:46:15 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-03 05:14:54 +0000

    makesyscalls: stop trying to remove . and .. in cleanup
    
    lfs.dir() will include these entries, but os.remove() cannot remove them
    for obvious reasons.
    
    (cherry picked from commit 340e009ecc00e5e74d58920ca909968dc7e88af1)
---
 sys/tools/makesyscalls.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua
index acae55050752..0ff4d53f924b 100644
--- a/sys/tools/makesyscalls.lua
+++ b/sys/tools/makesyscalls.lua
@@ -100,7 +100,9 @@ local function cleanup()
 	if cleantmp then
 		if lfs.dir(tmpspace) then
 			for fname in lfs.dir(tmpspace) do
-				os.remove(tmpspace .. "/" .. fname)
+				if fname ~= "." and fname ~= ".." then
+					os.remove(tmpspace .. "/" .. fname))
+				end
 			end
 		end
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110030515.1935FhYf008805>