| diff -aruN a/avahi-daemon/sd-daemon.c b/avahi-daemon/sd-daemon.c |
| --- a/avahi-daemon/sd-daemon.c 2010-07-12 17:45:20.000000000 -0700 |
| +++ b/avahi-daemon/sd-daemon.c 2010-09-08 09:52:29.000000000 -0700 |
| @@ -328,6 +328,11 @@ |
| #if defined(DISABLE_SYSTEMD) || !defined(__linux__) |
| return 0; |
| #else |
| +# if defined(SOCK_CLOEXEC) |
| + int sock_cloexec = SOCK_CLOEXEC; |
| +# else |
| +# define sock_cloexec 0 |
| +# endif |
| int fd = -1, r; |
| struct msghdr msghdr; |
| struct iovec iovec; |
| @@ -353,7 +358,7 @@ |
| goto finish; |
| } |
| |
| - if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { |
| + if ((fd = socket(AF_UNIX, SOCK_DGRAM|sock_cloexec, 0)) < 0) { |
| r = -errno; |
| goto finish; |
| } |