mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
topology: open topology files with O_TRUNC
The topology file if exists needs to rewritten, so we need to open these files with O_TRUNC flag as well Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
57ae61ce27
commit
9b09a3d500
1 changed files with 2 additions and 2 deletions
|
|
@ -260,7 +260,7 @@ int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
tplg->out_fd =
|
tplg->out_fd =
|
||||||
open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
open(outfile, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
||||||
if (tplg->out_fd < 0) {
|
if (tplg->out_fd < 0) {
|
||||||
SNDERR("error: failed to open %s err %d\n",
|
SNDERR("error: failed to open %s err %d\n",
|
||||||
outfile, -errno);
|
outfile, -errno);
|
||||||
|
|
@ -328,7 +328,7 @@ int snd_tplg_build(snd_tplg_t *tplg, const char *outfile)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
tplg->out_fd =
|
tplg->out_fd =
|
||||||
open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
open(outfile, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
||||||
if (tplg->out_fd < 0) {
|
if (tplg->out_fd < 0) {
|
||||||
SNDERR("error: failed to open %s err %d\n",
|
SNDERR("error: failed to open %s err %d\n",
|
||||||
outfile, -errno);
|
outfile, -errno);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue