diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-09-12 00:04:21 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-09-12 00:04:21 +0000 |
commit | 7f92542420ef6085b6f090954052266cc70af8a1 (patch) | |
tree | 86640b0497bf7f34c0c7df5b6c36bdf6ec78adea /src/pulsecore/authkey.c | |
parent | 54506ab44a9ac61e79b3a5c632db56bde41beded (diff) |
consolidate close() calls to pa_close(), and make sure on every occasion that we handle failures of close() sensibly
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1811 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/authkey.c')
-rw-r--r-- | src/pulsecore/authkey.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c index d8056247..4d9bfd3a 100644 --- a/src/pulsecore/authkey.c +++ b/src/pulsecore/authkey.c @@ -120,7 +120,10 @@ finish: if (unlock) pa_lock_fd(fd, 0); - close(fd); + if (pa_close(fd) < 0) { + pa_log_warn("Failed to close cookie file: %s", pa_cstrerror(errno)); + ret = -1; + } } return ret; @@ -221,7 +224,10 @@ finish: if (unlock) pa_lock_fd(fd, 0); - close(fd); + if (pa_close(fd) < 0) { + pa_log_warn("Failed to close cookie file: %s", pa_cstrerror(errno)); + ret = -1; + } } return ret; |