note/notestream: Call lib_fileoutstream_open in notefile_register
follow up fileoutstream change Signed-off-by: yangao1 <yangao1@xiaomi.com>
This commit is contained in:
parent
c560db04a6
commit
99303e9493
1 changed files with 3 additions and 4 deletions
|
|
@ -39,7 +39,6 @@ struct notestream_file_s
|
|||
{
|
||||
struct notestream_driver_s driver;
|
||||
struct lib_fileoutstream_s filestream;
|
||||
struct file file;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
@ -131,15 +130,15 @@ int notefile_register(FAR const char *filename)
|
|||
#endif
|
||||
|
||||
notefile->driver.stream = ¬efile->filestream.common;
|
||||
ret = file_open(¬efile->file, filename, O_WRONLY);
|
||||
notefile->driver.driver.ops = &g_notestream_ops;
|
||||
ret = lib_fileoutstream_open(¬efile->filestream,
|
||||
filename, O_WRONLY, 0666);
|
||||
if (ret < 0)
|
||||
{
|
||||
kmm_free(notefile);
|
||||
return ret;
|
||||
}
|
||||
|
||||
notefile->driver.driver.ops = &g_notestream_ops;
|
||||
lib_fileoutstream(¬efile->filestream, ¬efile->file);
|
||||
return note_driver_register(¬efile->driver.driver);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue