Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MU3lD-0000qu-On for mharc-grub-devel@gnu.org; Thu, 23 Jul 2009 15:15:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU3lC-0000qo-Sx for grub-devel@gnu.org; Thu, 23 Jul 2009 15:15:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU3l7-0000qT-SW for grub-devel@gnu.org; Thu, 23 Jul 2009 15:15:22 -0400 Received: from [199.232.76.173] (port=36114 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU3l7-0000qM-Oz for grub-devel@gnu.org; Thu, 23 Jul 2009 15:15:17 -0400 Received: from c60.cesmail.net ([216.154.195.49]:59016) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MU3l6-0004lX-R2 for grub-devel@gnu.org; Thu, 23 Jul 2009 15:15:17 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 23 Jul 2009 15:15:16 -0400 Received: from mj.roinet.com (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 3377334C6A for ; Thu, 23 Jul 2009 15:25:58 -0400 (EDT) To: grub-devel@gnu.org From: Pavel Roskin Date: Thu, 23 Jul 2009 15:15:13 -0400 Message-ID: <20090723191513.20427.12339.stgit@mj.roinet.com> User-Agent: StGit/0.15-rc1-9-gd8846 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] lua: change grub.file_seek() to return error code, not the old offset X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 19:15:23 -0000 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