diff options
author | NiteHawk <n1tehawk@users.noreply.github.com> | 2016-03-25 12:13:09 +0100 |
---|---|---|
committer | NiteHawk <n1tehawk@users.noreply.github.com> | 2016-03-25 13:07:13 +0100 |
commit | ba6d0e1ad9b12127a81a60514963b8c0919ea9b2 (patch) | |
tree | 4949ea9d923696f04d8fb1650fdd2449c4f7324a /src/lfs.c | |
parent | 95d946e0fed52f46d22bc9e77e6991cc516b05b5 (diff) | |
download | luafilesystem-ba6d0e1ad9b12127a81a60514963b8c0919ea9b2.tar.gz luafilesystem-ba6d0e1ad9b12127a81a60514963b8c0919ea9b2.tar.bz2 luafilesystem-ba6d0e1ad9b12127a81a60514963b8c0919ea9b2.zip |
Have make_link() use pushresult() instead of pusherror() on Windows
The pushresult(L, -1, ...) call will delegate to pusherror() anyway,
but this avoids the "Unused static" warning for pushresult.
Also take care of assigning something meaningful to `errno`, as
strerror(errno) is used for constructing the Lua error message.
Fixes #65
Diffstat (limited to 'src/lfs.c')
-rw-r--r-- | src/lfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -431,7 +431,8 @@ static int make_link(lua_State *L) | |||
431 | return pushresult(L, | 431 | return pushresult(L, |
432 | (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL); | 432 | (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL); |
433 | #else | 433 | #else |
434 | return pusherror(L, "make_link is not supported on Windows"); | 434 | errno = ENOSYS; /* = "Function not implemented" */ |
435 | return pushresult(L, -1, "make_link is not supported on Windows"); | ||
435 | #endif | 436 | #endif |
436 | } | 437 | } |
437 | 438 | ||