Skip to content

fix: set ENOENT errno in rmdir(undef)#286

Draft
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
atoomic:koan.atoomic/fix-rmdir-errno-undef
Draft

fix: set ENOENT errno in rmdir(undef)#286
Koan-Bot wants to merge 1 commit intocpanel:masterfrom
atoomic:koan.atoomic/fix-rmdir-errno-undef

Conversation

@Koan-Bot
Copy link
Contributor

What

__rmdir now sets $! = ENOENT when called with an undefined path argument.

Why

Every other CORE override that handles undef arguments (__mkdir, __symlink, __link, __readlink) properly sets $! before returning 0. __rmdir was the only one missing this, causing inconsistent errno behavior. Real CORE::rmdir(undef) sets errno to ENOENT.

How

One-line fix: added $! = ENOENT; before the return 0 in the undef-path guard. Updated t/rmdir.t to assert the errno value.

Testing

  • Updated existing "undef rmdir" subtest to verify $! == ENOENT after rmdir(undef)

🤖 Generated with Claude Code

Every other CORE override that handles undef arguments (mkdir, symlink,
link, readlink) sets $! before returning, but __rmdir was missing this.
Real CORE::rmdir(undef) sets $! to ENOENT — match that behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant