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>
int err = 0;
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) {
SNDERR("error: failed to open %s err %d\n",
outfile, -errno);
int err;
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) {
SNDERR("error: failed to open %s err %d\n",
outfile, -errno);