Dolda2000 GitWeb
/
ashd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b16800f
)
Use SOCK_SEQPACKET between processes to ensure EOF receipt. Probably only works on...
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 17 Dec 2008 02:16:43 +0000
(
03:16
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 17 Dec 2008 02:16:43 +0000
(
03:16
+0100)
lib/proc.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/proc.c
b/lib/proc.c
index
f7b0d9b
..
efd2767
100644
(file)
--- a/
lib/proc.c
+++ b/
lib/proc.c
@@
-35,7
+35,7
@@
int stdmkchild(char **argv)
pid_t pid;
int fd[2];
- if(socketpair(PF_UNIX, SOCK_
DGRAM
, 0, fd))
+ if(socketpair(PF_UNIX, SOCK_
SEQPACKET
, 0, fd))
return(-1);
if((pid = fork()) < 0)
return(-1);
@@
-98,8
+98,10
@@
int recvfd(int sock, char **data, size_t *datalen)
msg.msg_controllen = sizeof(cbuf);
ret = recvmsg(sock, &msg, 0);
- if(ret < 0) {
+ if(ret <
=
0) {
free(buf);
+ if(ret == 0)
+ errno = 0;
return(-1);
}