summaryrefslogtreecommitdiffstats
path: root/daemon/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/proto.c')
-rw-r--r--daemon/proto.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/proto.c b/daemon/proto.c
index f3b1fc0e..63d1cc99 100644
--- a/daemon/proto.c
+++ b/daemon/proto.c
@@ -39,6 +39,7 @@
#include "daemon.h"
#include "guestfs_protocol.h"
+#include "errnostring.h"
/* The message currently being processed. */
int proc_nr;
@@ -247,7 +248,11 @@ send_error (int errnum, const char *msg)
exit (EXIT_FAILURE);
}
- err.linux_errno = errnum;
+ /* These strings are not going to be freed. We just cast them
+ * to (char *) because they are defined that way in the XDR structs.
+ */
+ err.errno_string =
+ (char *) (errnum > 0 ? guestfs___errno_to_string (errnum) : "");
err.error_message = (char *) msg;
if (!xdr_guestfs_message_error (&xdr, &err)) {