From: Martin Mares Date: Sun, 31 Jul 2011 15:15:37 +0000 (+0200) Subject: fb-socket: Support shared fd's X-Git-Tag: v5.0~115 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ec35328dc92ebe10f1fec3e93ceea511c1764b5f;p=libucw.git fb-socket: Support shared fd's --- diff --git a/ucw/fb-socket.c b/ucw/fb-socket.c index dce8fffd..84395f09 100644 --- a/ucw/fb-socket.c +++ b/ucw/fb-socket.c @@ -105,7 +105,8 @@ fbs_spout(struct fastbuf *f) static void fbs_close(struct fastbuf *f) { - close(FB_SOCK(f)->par.fd); + if (!FB_SOCK(f)->par.fd_is_shared) + close(FB_SOCK(f)->par.fd); xfree(f); } diff --git a/ucw/fb-socket.h b/ucw/fb-socket.h index c9f6806b..004ed772 100644 --- a/ucw/fb-socket.h +++ b/ucw/fb-socket.h @@ -14,6 +14,7 @@ struct fbsock_params { /** Configuration of socket fastbuf. **/ int fd; + int fd_is_shared; uns bufsize; uns timeout_ms; void (*err)(void *data, uns flags, char *msg);