It will determine whether to use writev() or sendmsg().
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
struct xs_handle {
/* Communications channel to xenstore daemon. */
int fd;
+
+ bool is_socket; /* is @fd a file or socket? */
+
Xentoolcore__Active_Handle tc_ah; /* for restrict */
/*
if (stat(connect_to, &buf) != 0)
goto err;
- if (S_ISSOCK(buf.st_mode))
+ h->is_socket = S_ISSOCK(buf.st_mode);
+
+ if (h->is_socket)
h->fd = get_socket(connect_to);
else
h->fd = get_dev(connect_to);