Skip to content

Commit

Permalink
Merge branch 'fix/fsync-call-propagation-to-secondary-console_v5.2' i…
Browse files Browse the repository at this point in the history
…nto 'release/v5.2'

fix(console): Fsync not propagated to secondary output (backport v5.2)

See merge request espressif/esp-idf!30262
  • Loading branch information
ESP-Marius committed Jun 25, 2024
2 parents 921b8eb + 9bd81f4 commit 25fd5cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/vfs/vfs_console.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -104,7 +104,11 @@ int console_fcntl(int fd, int cmd, int arg)

int console_fsync(int fd)
{
return get_vfs_for_index(primary_vfs_index)->vfs.fsync(vfs_console.fd_primary);
const int ret_val = get_vfs_for_index(primary_vfs_index)->vfs.fsync(vfs_console.fd_primary);
#if CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
(void)get_vfs_for_index(secondary_vfs_index)->vfs.fsync(vfs_console.fd_secondary);
#endif
return ret_val;
}

#ifdef CONFIG_VFS_SUPPORT_DIR
Expand Down

0 comments on commit 25fd5cf

Please # to comment.