Navigation Menu

Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
win: Map ERROR_INVALID_FUNCTION to EISDIR
Browse files Browse the repository at this point in the history
This error is raised when calling read() or write() on a directory.

A bit of googling turns up some cases where this error can be raised
that are not properly mapped to EISDIR, but are also cases that libuv
doesn't really care about, like the Password Manager API,
GetFirmwareEnvironmentVariable, or CreateTapePartition.

If libuv ever needs to handle these cases, then I suppose that the
ERROR_INVALID_FUNCTION->EISDIR mapping could be done directly in the
fs read() and write() functions, but doing so at this point seems
premature, as it makes the error code mapping a bit more messy.

Fixes nodejs/node-v0.x-archive#4951
  • Loading branch information
isaacs committed Mar 8, 2013
1 parent 8fbe433 commit b68ee40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/win/error.c
Expand Up @@ -157,6 +157,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_SEM_TIMEOUT: return UV_ETIMEDOUT;
case WSAETIMEDOUT: return UV_ETIMEDOUT;
case ERROR_NOT_SAME_DEVICE: return UV_EXDEV;
case ERROR_INVALID_FUNCTION: return UV_EISDIR;
default: return UV_UNKNOWN;
}
}
Expand Down

0 comments on commit b68ee40

Please sign in to comment.