diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-11-18 16:45:08 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-11-18 16:45:08 +0000 |
commit | 6710296b7a597b0741b0559f2cefc3997986de40 (patch) | |
tree | f3c34ae0c656086ec7369fd1c3ad2c70f25d5cc0 | |
parent | 4ba8b5a00d7336e87e15a854b0534c630f456f7c (diff) | |
download | libguestfs-6710296b7a597b0741b0559f2cefc3997986de40.tar.gz libguestfs-6710296b7a597b0741b0559f2cefc3997986de40.tar.xz libguestfs-6710296b7a597b0741b0559f2cefc3997986de40.zip |
lua: Don't use %m since Lua string formatter doesn't understand it.
Use %s + strerror as a replacement.
-rw-r--r-- | generator/lua.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/generator/lua.ml b/generator/lua.ml index b561b3c1..874681c3 100644 --- a/generator/lua.ml +++ b/generator/lua.ml @@ -41,6 +41,7 @@ let generate_lua_c () = #include <stdint.h> #include <inttypes.h> #include <string.h> +#include <errno.h> /*#define LUA_LIB*/ #include <lua.h> @@ -112,7 +113,8 @@ lua_guestfs_create (lua_State *L) g = guestfs_create_flags (flags); if (!g) - return luaL_error (L, \"Guestfs.create: cannot create handle: %%m\"); + return luaL_error (L, \"Guestfs.create: cannot create handle: %%s\", + strerror (errno)); guestfs_set_error_handler (g, NULL, NULL); @@ -389,7 +391,8 @@ get_string_list (lua_State *L, int index) strs = malloc ((len+1) * sizeof (char *)); if (strs == NULL) { - luaL_error (L, \"get_string_list: malloc failed: %%m\"); + luaL_error (L, \"get_string_list: malloc failed: %%s\", + strerror (errno)); /*NOTREACHED*/ return NULL; } |