Skip to content

Commit f74663e

Browse files
committed
fix(esp_linenoise): close eventfd associated with an instance when deleting it
1 parent 9773e44 commit f74663e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

esp_linenoise/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.1"
1+
version: "1.0.2"
22
description: "ESP Linenoise - Line editing C library"
33
url: https://github.com/espressif/idf-extra-components/tree/master/esp_linenoise
44
license: Apache-2.0

esp_linenoise/src/esp_linenoise_internals.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ esp_err_t esp_linenoise_remove_event_fd(esp_linenoise_instance_t *instance)
136136
eventfd_pair_t *prev = NULL;
137137
SLIST_FOREACH(cur, &s_eventfd_pairs, next_pair) {
138138
if (cur->in_fd == config->in_fd) {
139+
/* close the eventfd */
140+
close(cur->eventfd);
141+
139142
if (prev == NULL) {
140143
/* remove head */
141144
SLIST_REMOVE_HEAD(&s_eventfd_pairs, next_pair);

0 commit comments

Comments
 (0)