mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
file: fix opening of non-existant files
This commit is contained in:
parent
50672b562d
commit
082986bf86
1 changed files with 5 additions and 6 deletions
|
@ -269,18 +269,17 @@ int file_start(struct vnode *n)
|
|||
|
||||
free(cpy);
|
||||
|
||||
/* Open file */
|
||||
|
||||
f->formatter->start(&n->in.signals);
|
||||
|
||||
/* Open file */
|
||||
f->stream_out = fopen(f->uri, "a+");
|
||||
if (!f->stream_out)
|
||||
return -1;
|
||||
|
||||
f->stream_in = fopen(f->uri, "r");
|
||||
if (!f->stream_in)
|
||||
return -1;
|
||||
|
||||
f->stream_out = fopen(f->uri, "a+");
|
||||
if (!f->stream_out)
|
||||
return -1;
|
||||
|
||||
if (f->buffer_size_in) {
|
||||
ret = setvbuf(f->stream_in, nullptr, _IOFBF, f->buffer_size_in);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue