g_autofree char *response = NULL;
size_t j;
size_t tapfd_len;
+ int saved_errno;
int http_res;
int rc;
payload = virBufferContentAndReset(&buf);
rc = virSocketSendMsgWithFDs(mon_sockfd, payload, tapfds, tapfd_len);
+ saved_errno = errno;
/* Close sent tap fds in Libvirt, as they have been dup()ed in CH */
for (j = 0; j < tapfd_len; j++) {
}
if (rc < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Failed to send net-add request to CH"));
+ virReportSystemError(saved_errno, "%s",
+ _("Failed to send net-add request to CH"));
return -1;
}
#include <config.h>
-#include "virerror.h"
#include "virsocket.h"
#include "virutil.h"
#include "virfile.h"
-#include "virlog.h"
#include <fcntl.h>
-#define VIR_FROM_THIS VIR_FROM_NONE
-
#ifdef WIN32
# define FD2SK(fd) _get_osfhandle(fd)
cmsg = CMSG_FIRSTHDR(&msg);
/* check to eliminate "potential null pointer dereference" errors during build */
if (!cmsg) {
- virReportSystemError(EFAULT, "%s", _("Couldn't fit control msg header in msg"));
+ errno = ENOSPC;
return -1;
}
ret = sendmsg(sock, &msg, 0);
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
- virReportSystemError(errno, "%s", _("sendmsg failed"));
- return -1;
- }
-
return ret;
}
int *fds G_GNUC_UNUSED,
size_t fds_len G_GNUC_UNUSED)
{
- virReportSystemError(ENOSYS, "%s",
- _("FD passing is not supported on this platform"));
+ errno = ENOSYS;
return -1;
}
#endif /* WIN32 */