From 6f447928066626e747df8f32485e71c393119a79 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Thu, 25 Jun 2009 12:07:12 +0200 Subject: Only declare saved_errno when it's going to be used (on Linux). --- src/pulsecore/core-util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/pulsecore/core-util.c') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 4550344f..6c94a71d 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2238,10 +2238,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"))) { -- cgit From bce211e41687f234f8c03fd6e4fd7490a0e0b7e2 Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Thu, 25 Jun 2009 12:28:16 +0200 Subject: Rename the flock variable to f_lock. flock() is a function on FreeBSD, and the variable shadowed its definition. --- src/pulsecore/core-util.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/pulsecore/core-util.c') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 6c94a71d..95111420 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -1193,22 +1193,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; } -- cgit From 1ca76031092ab07682843fd70607696f6af7216f Mon Sep 17 00:00:00 2001 From: Diego Elio 'Flameeyes' Pettenò Date: Thu, 25 Jun 2009 12:39:09 +0200 Subject: Add missing headers includes for FreeBSD. This removes the implicit declarations of send() and pthread_sigmask(). --- src/pulsecore/core-util.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pulsecore/core-util.c') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 95111420..04e7eb24 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef HAVE_STRTOF_L #include -- cgit