提交 8102307f 编写于 作者: M Markus Armbruster

qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'

gen_err_check() hard-codes 'local_err' instead of substituting the
argument.  Currently harmless, since all callers pass either None or
'local_err'.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 9b090d42
...@@ -29,14 +29,15 @@ def generate_command_decl(name, args, ret_type): ...@@ -29,14 +29,15 @@ def generate_command_decl(name, args, ret_type):
ret_type=c_type(ret_type), name=c_name(name), ret_type=c_type(ret_type), name=c_name(name),
args=arglist).strip() args=arglist).strip()
def gen_err_check(errvar): def gen_err_check(err):
if errvar: if not err:
return mcgen(''' return ''
if (local_err) { return mcgen('''
if (%(err)s) {
goto out; goto out;
} }
''') ''',
return '' err=err)
def gen_sync_call(name, args, ret_type): def gen_sync_call(name, args, ret_type):
ret = "" ret = ""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册