SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
32
plan9/wily/patches/patch-libmsg_connect_c
Normal file
32
plan9/wily/patches/patch-libmsg_connect_c
Normal file
|
@ -0,0 +1,32 @@
|
|||
--- libmsg/connect.c.orig Sun Apr 12 13:37:42 1998
|
||||
+++ libmsg/connect.c Sat May 24 13:12:29 2003
|
||||
@@ -109,11 +109,13 @@ client_connect(void)
|
||||
|
||||
/* bind it to a unix-domain at a temporary address */
|
||||
addr.sun_family = AF_UNIX;
|
||||
- tmpnam(addr.sun_path);
|
||||
+ sprintf(addr.sun_path, "%s/xx.XXXXXXXX", P_tmpdir);
|
||||
+ close(mkstemp(addr.sun_path));
|
||||
path = strdup(addr.sun_path);
|
||||
len = strlen(addr.sun_path);
|
||||
|
||||
if (bind(s, (struct sockaddr *) &addr, sizeof addr) < 0){
|
||||
+ unlink(path);
|
||||
perror("bind");
|
||||
return -1;
|
||||
}
|
||||
@@ -122,10 +124,14 @@ client_connect(void)
|
||||
|
||||
fd = wilyfifotalk(); /* fifo to wily */
|
||||
if(fd<0)
|
||||
+ {
|
||||
+ unlink(path);
|
||||
return -1;
|
||||
+ }
|
||||
nwritten = write(fd, addr.sun_path, len);
|
||||
close(fd);
|
||||
if(nwritten !=len){
|
||||
+ unlink(path);
|
||||
perror("write to wily");
|
||||
return -1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue