Files
cworker/main.c
2023-08-19 00:40:40 +02:00

38 lines
738 B
C

/*
*
* Copyright 2023 Oleg Borodin <borodin@unix7.org>
*
*/
#include <stdio.h>
#include <cworker.h>
#include <logger.h>
int main(int argc, char **argv) {
cworker_t worker;
if (cworker_init(&worker, argv, argc) < 0) {
log_error("cannot init service");
return 1;
}
if (cworker_detach(&worker) < 0) {
log_error("cannot detach service");
return 1;
}
if (cworker_writepid(&worker) < 0) {
log_error("cannot build service");
return 1;
}
if (cworker_build(&worker) < 0) {
log_error("cannot build service");
return 1;
}
if (cworker_run(&worker) < 0) {
log_error("cannot run service");
return 1;
}
return 0;
}