fs: fix misplaced errors in fs.symlinkSync
The ctx.error is supposed to be handled in fs.readlinkSync, but was handled in fs.symlinkSync by mistake.
Also fix the error number check in readlink to be consistent with SYNC_CALL.
Refs: https://github.com/nodejs/node/pull/18348
This is an oversight of https://github.com/nodejs/node/pull/18348, the error handling was supposed to be in fs.readlinkSync
instead of fs.symlinkSync
. I couldn't come up with a test because these errors cannot be triggered easily:
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
fs