projects
/
platform
/
upstream
/
pulseaudio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c77c6e
)
* some minor pid file fixes
author
Lennart Poettering
<lennart@poettering.net>
Sun, 21 Nov 2004 00:04:17 +0000
(
00:04
+0000)
committer
Lennart Poettering
<lennart@poettering.net>
Sun, 21 Nov 2004 00:04:17 +0000
(
00:04
+0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@297
fefdeb5f
-60dc-0310-8127-
8f9354f1896f
polyp/pid.c
patch
|
blob
|
history
diff --git
a/polyp/pid.c
b/polyp/pid.c
index
142c4f6
..
a52bed0
100644
(file)
--- a/
polyp/pid.c
+++ b/
polyp/pid.c
@@
-90,9
+90,12
@@
int pa_pid_file_create(void) {
pa_log(__FILE__": stale PID file, overwriting.\n");
}
- lseek(fd, 0, SEEK_SET);
+ if (lseek(fd, 0, SEEK_SET) == (off_t) -1 || ftruncate(fd, 0) < 0) {
+ pa_log(__FILE__": failed to truncate PID fil: %s.\n", strerror(errno));
+ goto fail;
+ }
- snprintf(t, sizeof(t), "%lu", (unsigned long) getpid());
+ snprintf(t, sizeof(t), "%lu
\n
", (unsigned long) getpid());
l = strlen(t);
if (pa_loop_write(fd, t, l) != (ssize_t) l) {