grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] lua: change grub.file_seek() to return error code, not the old o


From: Pavel Roskin
Subject: [PATCH] lua: change grub.file_seek() to return error code, not the old offset
Date: Thu, 23 Jul 2009 15:15:13 -0400
User-agent: StGit/0.15-rc1-9-gd8846

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]