mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-16 08:56:40 -05:00
Fix a potential C++/C99 ism, add a log message on error condition
Signed-off-by: Lennart Poettering <lennart@poettering.net>
This commit is contained in:
parent
068afb3478
commit
91b64bc96b
1 changed files with 5 additions and 2 deletions
|
|
@ -211,6 +211,7 @@ int pa_pid_file_create(const char *procname) {
|
||||||
if ((pid = read_pid(fn, fd)) == (pid_t) -1)
|
if ((pid = read_pid(fn, fd)) == (pid_t) -1)
|
||||||
pa_log_warn("Corrupt PID file, overwriting.");
|
pa_log_warn("Corrupt PID file, overwriting.");
|
||||||
else if (pid > 0) {
|
else if (pid > 0) {
|
||||||
|
int ours = 1;
|
||||||
|
|
||||||
#ifdef OS_IS_WIN32
|
#ifdef OS_IS_WIN32
|
||||||
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL) {
|
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL) {
|
||||||
|
|
@ -218,11 +219,13 @@ int pa_pid_file_create(const char *procname) {
|
||||||
#else
|
#else
|
||||||
if (kill(pid, 0) >= 0 || errno != ESRCH) {
|
if (kill(pid, 0) >= 0 || errno != ESRCH) {
|
||||||
#endif
|
#endif
|
||||||
int ours = 1;
|
|
||||||
|
|
||||||
if (procname)
|
if (procname)
|
||||||
if ((ours = proc_name_ours(pid, procname)) < 0)
|
if ((ours = proc_name_ours(pid, procname)) < 0) {
|
||||||
|
pa_log_warn("Could not check to see if pid %lu is a pulseaudio process. "
|
||||||
|
"Asssuming it is and the daemon is already running.", (unsigned long) pid);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (ours) {
|
if (ours) {
|
||||||
pa_log("Daemon already running.");
|
pa_log("Daemon already running.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue