From 527ee83f39c306afaca7dfdd2b661af4e279c8d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:04:06 +0000 Subject: [PATCH 1/2] Initial plan From 374bca9c55fee189d31507ddf16c1165c45166b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 20:07:33 +0000 Subject: [PATCH 2/2] Fix file listing - distinguish file from directory in opendir error Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- src/dmdevfs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dmdevfs.c b/src/dmdevfs.c index 19d713b..9d0fefa 100644 --- a/src/dmdevfs.c +++ b/src/dmdevfs.c @@ -601,6 +601,15 @@ dmod_dmfsi_dif_api_declaration( 1.0, dmdevfs, int, _opendir, (dmfsi_context_t ct if (!is_directory(ctx, path)) { + // Check if the path is a file (device node) + driver_node_t* driver_node = find_driver_node(ctx, path); + if (driver_node != NULL) + { + // Path exists but is a file, not a directory + DMOD_LOG_ERROR("Not a directory: %s\n", path); + return DMFSI_ERR_NOT_FOUND; + } + // Path doesn't exist at all DMOD_LOG_ERROR("Directory not found: %s\n", path); return DMFSI_ERR_NOT_FOUND; }