mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
pipe: check return value of mkfifo()
This commit is contained in:
parent
c87fd823ea
commit
77e73be925
2 changed files with 8 additions and 2 deletions
|
|
@ -255,7 +255,10 @@ int pa__init(pa_module *m) {
|
||||||
|
|
||||||
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
|
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
|
||||||
|
|
||||||
mkfifo(u->filename, 0666);
|
if (mkfifo(u->filename, 0666) < 0) {
|
||||||
|
pa_log("mkfifo('%s'): %s", u->filename, pa_cstrerror(errno));
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
|
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
|
||||||
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
|
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,10 @@ int pa__init(pa_module *m) {
|
||||||
|
|
||||||
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
|
u->filename = pa_runtime_path(pa_modargs_get_value(ma, "file", DEFAULT_FILE_NAME));
|
||||||
|
|
||||||
mkfifo(u->filename, 0666);
|
if (mkfifo(u->filename, 0666) < 0) {
|
||||||
|
pa_log("mkfifo('%s'): %s", u->filename, pa_cstrerror(errno));
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
|
if ((u->fd = pa_open_cloexec(u->filename, O_RDWR, 0)) < 0) {
|
||||||
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
|
pa_log("open('%s'): %s", u->filename, pa_cstrerror(errno));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue