]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/edit-util: ignore ENOTDIR when trying editors
authorPablo Fraile Alonso <pablo@pablofraile.net>
Thu, 25 Dec 2025 12:32:43 +0000 (13:32 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 5 Jan 2026 13:22:11 +0000 (22:22 +0900)
src/shared/edit-util.c

index e5d976fb0091cd7c8fb903cde19d99380a278f12..d48c36c1d5c2bfeb59f071404b58838775640efc 100644 (file)
@@ -298,6 +298,12 @@ static int run_editor_child(const EditFileContext *context) {
 
                 execvp(args[0], (char* const*) args);
 
+                if (errno == ENOTDIR) {
+                        log_debug_errno(errno,
+                                        "Failed to execute '%s': a path component is not a directory, skipping...",
+                                        name);
+                        continue;
+                }
                 /* We do not fail if the editor doesn't exist because we want to try each one of them
                  * before failing. */
                 if (errno != ENOENT)