This makes it easier to check if the call has succeeded. The old offset is rarely needed.
ChangeLog: * script/lua/grub_lib.c (grub_lua_file_seek): Return error code, not the old offset. --- script/lua/grub_lib.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c index d26f193..42f370a 100644 --- a/script/lua/grub_lib.c +++ b/script/lua/grub_lib.c @@ -266,12 +266,9 @@ grub_lua_file_seek (lua_State *state) luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); file = lua_touserdata (state, 1); offset = luaL_checkinteger (state, 2); + grub_file_seek (file, offset); - offset = grub_file_seek (file, offset); - save_errno (state); - - lua_pushinteger (state, offset); - return 1; + return push_result (state); } static int _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel