mirror of
https://github.com/FunKey-Project/fkgpiod.git
synced 2026-01-26 17:54:43 +01:00
removed fopencookie for redirecting logs in daemon mode because of (again) muslc incompatibility
This commit is contained in:
parent
de28915863
commit
bdbe6e354a
5
main.c
5
main.c
@ -213,10 +213,15 @@ int main(int argc, char *argv[])
|
||||
if (daemon) {
|
||||
|
||||
/* Run as a background daemon, redirect all output to syslog */
|
||||
printf("Func %s, line %d\n", __func__, __LINE__);
|
||||
openlog("fkgpiod", LOG_PERROR | LOG_PID | LOG_NDELAY, LOG_DAEMON);
|
||||
printf("Func %s, line %d\n", __func__, __LINE__);
|
||||
to_log(&stdout);
|
||||
printf("Func %s, line %d\n", __func__, __LINE__);
|
||||
to_log(&stderr);
|
||||
printf("Func %s, line %d\n", __func__, __LINE__);
|
||||
daemonize("/", PID_FILE);
|
||||
printf("Func %s, line %d\n", __func__, __LINE__);
|
||||
}
|
||||
|
||||
/* Initialize the uinput device */
|
||||
|
||||
3
to_log.c
3
to_log.c
@ -81,5 +81,6 @@ static cookie_io_functions_t log_fns = {
|
||||
/* Redirect given file output descriptor to syslog */
|
||||
void to_log(FILE **pfp)
|
||||
{
|
||||
setvbuf(*pfp = fopencookie(NULL, "w", log_fns), NULL, _IOLBF, 0);
|
||||
//setvbuf(*pfp = fopencookie(NULL, "w", log_fns), NULL, _IOLBF, 0); //not working with muslc
|
||||
setvbuf(*pfp, NULL, _IOLBF, 0);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user