diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-03-20 12:27:14 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-03-20 12:27:44 +0000 |
commit | f62db21d8babc14d580f754b0bf4d0cbe3c5bc9d (patch) | |
tree | 883655151aef9b96686af2cc7f3fc3dad91764e0 /generator | |
parent | 7526df547c5bea9a0cb4370ca022e413388dce2e (diff) | |
download | libguestfs-f62db21d8babc14d580f754b0bf4d0cbe3c5bc9d.tar.gz libguestfs-f62db21d8babc14d580f754b0bf4d0cbe3c5bc9d.tar.xz libguestfs-f62db21d8babc14d580f754b0bf4d0cbe3c5bc9d.zip |
daemon: Set last errno to ENOTSUP when APIs are not available.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/generator_daemon.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/generator/generator_daemon.ml b/generator/generator_daemon.ml index 8c960619..0f83bc48 100644 --- a/generator/generator_daemon.ml +++ b/generator/generator_daemon.ml @@ -68,6 +68,7 @@ and generate_daemon_actions () = pr "#include <stdlib.h>\n"; pr "#include <string.h>\n"; pr "#include <inttypes.h>\n"; + pr "#include <errno.h>\n"; pr "#include <rpc/types.h>\n"; pr "#include <rpc/xdr.h>\n"; pr "\n"; @@ -132,10 +133,11 @@ and generate_daemon_actions () = pr " if (! optgroup_%s_available ()) {\n" group; if is_filein then pr " cancel_receive ();\n"; - pr " reply_with_error (\"feature '%%s' is not available in this\\n\"\n"; - pr " \"build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\\n\"\n"; - pr " \"how to check for the availability of features.\",\n"; - pr " \"%s\");\n" group; + pr " reply_with_error_errno (ENOTSUP,\n"; + pr " \"feature '%%s' is not available in this\\n\"\n"; + pr " \"build of libguestfs. Read 'AVAILABILITY' in the guestfs(3) man page for\\n\"\n"; + pr " \"how to check for the availability of features.\",\n"; + pr " \"%s\");\n" group; pr " goto done_no_free;\n"; pr " }\n"; pr "\n" |