mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
sched: rework file handling API
Replace SCH_*InputFileHandler() functions with more general SCH_*FileHandler(), where events are specified as a new parameter and which will later support other file events, e.g. file ready for ouput and exception. The file handlers have two new parameters: file descriptor and event.
This commit is contained in:
@@ -72,7 +72,7 @@ start_resolving(void *anything)
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
end_resolving(void *anything)
|
||||
end_resolving(int fd, int event, void *anything)
|
||||
{
|
||||
struct DNS_Async_Instance *inst = (struct DNS_Async_Instance *)anything;
|
||||
int i;
|
||||
@@ -83,7 +83,7 @@ end_resolving(void *anything)
|
||||
|
||||
resolving_threads--;
|
||||
|
||||
SCH_RemoveInputFileHandler(inst->pipe[0]);
|
||||
SCH_RemoveFileHandler(inst->pipe[0]);
|
||||
close(inst->pipe[0]);
|
||||
close(inst->pipe[1]);
|
||||
|
||||
@@ -120,7 +120,7 @@ DNS_Name2IPAddressAsync(const char *name, DNS_NameResolveHandler handler, void *
|
||||
LOG_FATAL(LOGF_Nameserv, "pthread_create() failed");
|
||||
}
|
||||
|
||||
SCH_AddInputFileHandler(inst->pipe[0], end_resolving, inst);
|
||||
SCH_AddFileHandler(inst->pipe[0], SCH_FILE_INPUT, end_resolving, inst);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user