mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
pcm_file: call pclose() correctly for popen() (coverity)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d5a1cf35b7
commit
22ade9b8c1
1 changed files with 8 additions and 1 deletions
|
|
@ -227,7 +227,14 @@ static int snd_pcm_file_open_output_file(snd_pcm_file_t *file)
|
||||||
file->final_fname);
|
file->final_fname);
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
fd = fileno(pipe);
|
fd = dup(fileno(pipe));
|
||||||
|
err = -errno;
|
||||||
|
pclose(pipe);
|
||||||
|
if (fd < 0) {
|
||||||
|
SYSERR("unable to dup pipe file handle for command %s",
|
||||||
|
file->final_fname);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (file->trunc)
|
if (file->trunc)
|
||||||
fd = open(file->final_fname, O_WRONLY|O_CREAT|O_TRUNC,
|
fd = open(file->final_fname, O_WRONLY|O_CREAT|O_TRUNC,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue