summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/pid.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-09-11 20:48:33 +0000
committerLennart Poettering <lennart@poettering.net>2007-09-11 20:48:33 +0000
commitd5bedbcd98c10ef187f1daa326b32c6f3ba8d3af (patch)
treeb7ad2d06169bad49cb4d86d4c2c94473a189a91a /src/pulsecore/pid.c
parent2988c3d9fbe52ba0429b4962446273bceda391f6 (diff)
remaining s/assert/pa_assert/ and refcnt.h modernizations
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1809 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/pid.c')
-rw-r--r--src/pulsecore/pid.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c
index efb6e64e..22ceae89 100644
--- a/src/pulsecore/pid.c
+++ b/src/pulsecore/pid.c
@@ -33,7 +33,6 @@
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
-#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <signal.h>
@@ -47,6 +46,7 @@
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
+#include <pulsecore/macro.h>
#include "pid.h"
@@ -57,7 +57,8 @@ static pid_t read_pid(const char *fn, int fd) {
char t[20], *e;
uint32_t pid;
- assert(fn && fd >= 0);
+ pa_assert(fn);
+ pa_assert(fd >= 0);
if ((r = pa_loop_read(fd, t, sizeof(t)-1, NULL)) < 0) {
pa_log_warn("WARNING: failed to read PID file '%s': %s",
@@ -73,7 +74,7 @@ static pid_t read_pid(const char *fn, int fd) {
*e = 0;
if (pa_atou(t, &pid) < 0) {
- pa_log("WARNING: failed to parse PID file '%s'", fn);
+ pa_log_warn("WARNING: failed to parse PID file '%s'", fn);
return (pid_t) -1;
}
@@ -83,6 +84,8 @@ static pid_t read_pid(const char *fn, int fd) {
static int open_pid_file(const char *fn, int mode) {
int fd = -1;
+ pa_assert(fn);
+
for (;;) {
struct stat st;
@@ -238,7 +241,7 @@ fail:
if (fd >= 0) {
pa_lock_fd(fd, 0);
- close(fd);
+ pa_assert_se(close(fd) == 0);
}
return ret;
@@ -280,7 +283,7 @@ fail:
if (fd >= 0) {
pa_lock_fd(fd, 0);
- close(fd);
+ pa_assert_se(close(fd) == 0);
}
return ret;