FD exchange: fix two minor memory problems.
parent
9462224255
commit
2befab21e2
|
@ -201,14 +201,14 @@ pub fn receive_fd(sockfd: os.socket_t, buffer: []u8, msg_size: *usize) !os.fd_t
|
||||||
var cmsg = Cmsghdr(os.fd_t).init(.{
|
var cmsg = Cmsghdr(os.fd_t).init(.{
|
||||||
.level = os.SOL.SOCKET,
|
.level = os.SOL.SOCKET,
|
||||||
.@"type" = SCM_RIGHTS,
|
.@"type" = SCM_RIGHTS,
|
||||||
.data = undefined,
|
.data = 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
var msg: std.os.msghdr = .{
|
var msg: std.os.msghdr = .{
|
||||||
.name = undefined
|
.name = null
|
||||||
, .namelen = 0
|
, .namelen = 0
|
||||||
, .iov = &iov
|
, .iov = &iov
|
||||||
, .iovlen = 2
|
, .iovlen = 1
|
||||||
, .control = &cmsg
|
, .control = &cmsg
|
||||||
, .controllen = @sizeOf(@TypeOf(cmsg))
|
, .controllen = @sizeOf(@TypeOf(cmsg))
|
||||||
, .flags = 0
|
, .flags = 0
|
||||||
|
|
Reference in New Issue