errno is not reset after require
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: errno is not reset after require
- From: Iurii Belobeev <marsgpl@...>
- Date: Sat, 4 Nov 2023 01:01:35 -0300
Hi,
I have the code:
printf("errno: %d\n", errno);
lua_getglobal(L, "require");
lua_pushliteral(L, "mymodule");
lua_call(L, 1, 1);
printf("errno: %d\n", errno);
package.cpath:
/mydir/?/?.so
mymodule exists:
/mydir/mymodule/mymodule.so
It is being required successfully.
The wrong thing here for me is that errno is set to 2 (No such file or directory) after the successful require.
It gives me some trouble later.
Is such behavior expected here?
Or I'm doing something wrong?
Regards,
Iurii.