generator: fix daemon functions with optional params but no mandatory params

The
  struct guestfs_$function_args args;
declaration was not emitted in that case, leading to build failure.
This commit is contained in:
Pino Toscano
2014-05-29 10:32:15 +02:00
parent 00d94d95c8
commit 4d8ecb0d30

View File

@@ -1658,9 +1658,9 @@ and generate_client_actions hash () =
let args_passed_to_daemon =
List.filter (function FileIn _ | FileOut _ -> false | _ -> true)
args in
(match args_passed_to_daemon with
| [] -> ()
| _ -> pr " struct guestfs_%s_args args;\n" name
(match args_passed_to_daemon, optargs with
| [], [] -> ()
| _, _ -> pr " struct guestfs_%s_args args;\n" name
);
pr " guestfs_message_header hdr;\n";