mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-23 06:59:53 -05:00
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
This commit is contained in:
parent
2988c3d9fb
commit
d5bedbcd98
59 changed files with 967 additions and 724 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue