grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 0'
grep_log socket '\(PF_(LOCAL|UNIX|FILE), SOCK_STREAM, 0\) += 1'
-grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 110\) += 0'
+grep_log bind '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
grep_log listen '\(0, 5\) += 0'
grep_log getsockname '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, \[15\]\) += 0'
grep_log accept '\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), NULL\}, \[2\]\) += 1'
-grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 110\) += 0'
+grep_log connect '\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="local-stream"\}, 15\) += 0'
exit 0
#include <assert.h>
+#include <stddef.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
.sun_family = AF_UNIX,
.sun_path = SUN_PATH
};
- socklen_t len = sizeof addr;
+ socklen_t len = offsetof(struct sockaddr_un, sun_path) + sizeof SUN_PATH;
unlink(SUN_PATH);
close(0);
} else {
assert(socket(PF_LOCAL, SOCK_STREAM, 0) == 1);
assert(close(0) == 0);
- assert(connect(1, (struct sockaddr *) &addr, sizeof addr) == 0);
+ assert(connect(1, (struct sockaddr *) &addr, len) == 0);
assert(close(1) == 0);
return 0;
}