diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2009-06-29 18:55:12 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2009-06-29 18:55:12 +0300 |
commit | c266595058416b4b776890dadf3ad827787f4e7e (patch) | |
tree | bfedd08b4579c33b62d42da88498b6c26088b88e /src/pulsecore/core-util.c | |
parent | 0bc538b08ca5c4efea86700cb6c4685da3f34345 (diff) | |
parent | 1ca76031092ab07682843fd70607696f6af7216f (diff) |
Merge branch 'master' into dbus-work
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r-- | src/pulsecore/core-util.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 4550344f..04e7eb24 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -43,6 +43,7 @@ #include <regex.h> #include <langinfo.h> #include <sys/utsname.h> +#include <sys/socket.h> #ifdef HAVE_STRTOF_L #include <locale.h> @@ -1193,22 +1194,22 @@ int pa_check_in_group(gid_t g) { (advisory on UNIX, mandatory on Windows) */ int pa_lock_fd(int fd, int b) { #ifdef F_SETLKW - struct flock flock; + struct flock f_lock; /* Try a R/W lock first */ - flock.l_type = (short) (b ? F_WRLCK : F_UNLCK); - flock.l_whence = SEEK_SET; - flock.l_start = 0; - flock.l_len = 0; + f_lock.l_type = (short) (b ? F_WRLCK : F_UNLCK); + f_lock.l_whence = SEEK_SET; + f_lock.l_start = 0; + f_lock.l_len = 0; - if (fcntl(fd, F_SETLKW, &flock) >= 0) + if (fcntl(fd, F_SETLKW, &f_lock) >= 0) return 0; /* Perhaps the file descriptor qas opened for read only, than try again with a read lock. */ if (b && errno == EBADF) { - flock.l_type = F_RDLCK; - if (fcntl(fd, F_SETLKW, &flock) >= 0) + f_lock.l_type = F_RDLCK; + if (fcntl(fd, F_SETLKW, &f_lock) >= 0) return 0; } @@ -2238,10 +2239,9 @@ int pa_close_all(int except_fd, ...) { int pa_close_allv(const int except_fds[]) { struct rlimit rl; int maxfd, fd; - int saved_errno; #ifdef __linux__ - + int saved_errno; DIR *d; if ((d = opendir("/proc/self/fd"))) { |