From 261f8c910bd459bec3fa40dff877ecc4fc3e4503 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Aug 2020 21:07:06 +1000 Subject: [PATCH] utils: rename the sources close behavior for extra clarity Signed-off-by: Peter Hutterer --- src/util-sources.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util-sources.c b/src/util-sources.c index 99d746c..707582b 100644 --- a/src/util-sources.c +++ b/src/util-sources.c @@ -40,9 +40,9 @@ struct sink { }; enum source_close_behavior { - SOURCE_CLOSE_ON_REMOVE = 1, /* default */ - SOURCE_CLOSE_ON_DESTROY, - SOURCE_CLOSE_NEVER, + SOURCE_CLOSE_FD_ON_REMOVE = 1, /* default */ + SOURCE_CLOSE_FD_ON_DESTROY, + SOURCE_CLOSE_FD_NEVER, }; struct source { @@ -70,7 +70,7 @@ source_remove(struct source *source) { if (source->fd != -1) { epoll_ctl(source->sink->epollfd, EPOLL_CTL_DEL, source->fd, NULL); - if (source->close_behavior == SOURCE_CLOSE_ON_REMOVE) + if (source->close_behavior == SOURCE_CLOSE_FD_ON_REMOVE) source->fd = xclose(source->fd); } /* Note: epollfd was the owner of the source, new owner is the removed @@ -85,7 +85,7 @@ source_destroy(struct source *source) { if (source->fd != -1) { source_remove(source); - if (source->close_behavior == SOURCE_CLOSE_ON_DESTROY) + if (source->close_behavior == SOURCE_CLOSE_FD_ON_DESTROY) source->fd = xclose(source->fd); } } @@ -126,7 +126,7 @@ source_add_autoclose(struct sink *sink, int sourcefd, source_dispatch_t dispatch, void *user_data) { - return source_add(sink, sourcefd, dispatch, user_data, SOURCE_CLOSE_ON_REMOVE); + return source_add(sink, sourcefd, dispatch, user_data, SOURCE_CLOSE_FD_ON_REMOVE); } static void