mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-01 06:12:31 +00:00
Correct calculation of the socklen_t length when bind-ing the AF_UNIX socket,
as some systems have extra bytes in the sockaddr_un that weren't accounted for in the original calculation. Follow the POSIX spec instead. modified: src/unixcomm.c modified: src/unixfork.c
This commit is contained in:
@@ -472,10 +472,11 @@ int fork_Unix() {
|
||||
exit(0);
|
||||
}
|
||||
sprintf(PipeName, "/tmp/LPU%ld-%d", StartTime, slot);
|
||||
memset(&addr, 0, sizeof(struct sockaddr_un));
|
||||
addr.sun_family = AF_UNIX;
|
||||
strcpy(addr.sun_path, PipeName);
|
||||
status =
|
||||
connect(sock, (struct sockaddr *)&addr, strlen(PipeName) + sizeof(addr.sun_family));
|
||||
connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_un));
|
||||
if (status < 0) {
|
||||
perror("slave connect");
|
||||
printf("Name = %s.\n", PipeName);
|
||||
|
||||
Reference in New Issue
Block a user