summaryrefslogtreecommitdiffstats
path: root/daemon/daemon.h
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-20 12:25:40 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-20 12:25:40 +0000
commit7526df547c5bea9a0cb4370ca022e413388dce2e (patch)
tree03db3bcb9bae7ca91364234ca84d11f8705e8feb /daemon/daemon.h
parentc7dff02ccbb6bbe505c73df5d83bea8afdc188c3 (diff)
downloadlibguestfs-7526df547c5bea9a0cb4370ca022e413388dce2e.tar.gz
libguestfs-7526df547c5bea9a0cb4370ca022e413388dce2e.tar.xz
libguestfs-7526df547c5bea9a0cb4370ca022e413388dce2e.zip
daemon: Add reply_with_error_errno function.
This function allows you to pass an explicit errno back to the library. reply_with_error is redefined as a macro that calls reply_with_error_errno with errno == 0.
Diffstat (limited to 'daemon/daemon.h')
-rw-r--r--daemon/daemon.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/daemon/daemon.h b/daemon/daemon.h
index b7c1fd8e..9dfaa4f3 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -174,10 +174,11 @@ extern void main_loop (int sock) __attribute__((noreturn));
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
*/
-extern void reply_with_error (const char *fs, ...)
- __attribute__((format (printf,1,2)));
+extern void reply_with_error_errno (int err, const char *fs, ...)
+ __attribute__((format (printf,2,3)));
extern void reply_with_perror_errno (int err, const char *fs, ...)
__attribute__((format (printf,2,3)));
+#define reply_with_error(...) reply_with_error_errno(0, __VA_ARGS__)
#define reply_with_perror(...) reply_with_perror_errno(errno, __VA_ARGS__)
/* daemon functions that receive files (FileIn) should call