Add casts for the addr arg of connect and bind
glibc allows the addr arg to connect and socket to be any of a number of 'sockaddr_*' types, but musl requires 'const struct sockaddr *' which is in line with open group specs. So add casts to allow compilation with musl. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: NeilBrown <neilb@suse.com>
This commit is contained in:
parent
cf80bce8df
commit
50d72ed429
2
mdmon.c
2
mdmon.c
|
@ -235,7 +235,7 @@ static int make_control_sock(char *devname)
|
||||||
addr.sun_family = PF_LOCAL;
|
addr.sun_family = PF_LOCAL;
|
||||||
strcpy(addr.sun_path, path);
|
strcpy(addr.sun_path, path);
|
||||||
umask(077); /* ensure no world write access */
|
umask(077); /* ensure no world write access */
|
||||||
if (bind(sfd, &addr, sizeof(addr)) < 0) {
|
if (bind(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||||
close(sfd);
|
close(sfd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
2
msg.c
2
msg.c
|
@ -170,7 +170,7 @@ int connect_monitor(char *devname)
|
||||||
|
|
||||||
addr.sun_family = PF_LOCAL;
|
addr.sun_family = PF_LOCAL;
|
||||||
strcpy(addr.sun_path, path);
|
strcpy(addr.sun_path, path);
|
||||||
if (connect(sfd, &addr, sizeof(addr)) < 0) {
|
if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||||
close(sfd);
|
close(sfd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue