Fix bug in logging for VFS start_select function

Resolves issue identified in https://github.com/espressif/esp-idf/issues/18398 by seperating logging when `vfs == NULL`

Closes https://github.com/espressif/esp-idf/pull/18400
Closes https://github.com/espressif/esp-idf/issues/18398
This commit is contained in:
gadget-man
2026-03-27 21:40:48 +00:00
committed by Adam Múdry
parent b6713bf40f
commit aad525da10

View File

@@ -645,8 +645,13 @@ int esp_vfs_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds
const vfs_entry_t *vfs = get_vfs_for_index(i);
fds_triple_t *item = &vfs_fds_triple[i];
if (vfs == NULL || vfs->vfs->select == NULL || vfs->vfs->select->start_select == NULL) {
ESP_LOGD(TAG, "start_select function callback for this vfs (s_vfs[%d]) is not defined", vfs->offset);
if (vfs == NULL) {
ESP_LOGD(TAG, "start_select callback not defined: vfs is NULL at index %u", (unsigned)i);
continue;
}
if (vfs->vfs == NULL || vfs->vfs->select == NULL || vfs->vfs->select->start_select == NULL) {
ESP_LOGD(TAG, "start_select callback not defined for VFS offset %d", vfs->offset);
continue;
}