X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fproto.c;h=63d1cc990003652924da66ad6ed3d4b8bd7b4953;hp=02ee6925fdd29b5410d5dd8e46dce315afc41bcb;hb=428a45c3e15f03e9861e1b551e1ae8da821dba5f;hpb=e776a46ffcbede6d9b030dbc8f6ab32500b325ec diff --git a/daemon/proto.c b/daemon/proto.c index 02ee692..63d1cc9 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -38,7 +38,8 @@ #include "ignore-value.h" #include "daemon.h" -#include "../src/guestfs_protocol.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)) {