1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

Kernel+LibC: Don't allow a directory to become a subdirectory of itself

If you try to do this (e.g "mv directory directory"), sys$rename() will
now fail with EDIRINTOSELF.

Dr. POSIX says we should return EINVAL for this, but a custom error
code allows us to print a much more helpful error message when this
problem occurs. :^)
This commit is contained in:
Andreas Kling 2020-11-01 17:17:23 +01:00
parent 13aa3d2d62
commit a28f29c82c
3 changed files with 8 additions and 1 deletions

View file

@ -364,6 +364,7 @@ const char* const sys_errlist[] = {
"Protocol error",
"Not supported",
"Protocol family not supported",
"Cannot make directory a subdirectory of itself",
"The highest errno +1 :^)",
};