mirror of
https://github.com/troglobit/finit.git
synced 2026-11-25 20:28:23 +00:00
svc.c: Replace daemon-only logging API with API from err.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
0f64e18f27
commit
d56031db7d
1 file changed
+3
-4
@@ -22,6 +22,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <err.h>
|
||||||
#include <ctype.h> /* isdigit() */
|
#include <ctype.h> /* isdigit() */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
@@ -42,7 +43,7 @@ static svc_t *__connect_shm(void)
|
|||||||
if (!list) {
|
if (!list) {
|
||||||
/* This should never happen, but if it does we're probably
|
/* This should never happen, but if it does we're probably
|
||||||
* knee-deep in more serious problems already... */
|
* knee-deep in more serious problems already... */
|
||||||
_e("Failed connecting to shared memory, error %d: %s", errno, strerror(errno));
|
warn("Failed connecting to shared memory, error %d", errno);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,10 +314,8 @@ svc_t *svc_find(char *cmd, int id)
|
|||||||
svc_t *svc;
|
svc_t *svc;
|
||||||
|
|
||||||
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
|
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
|
||||||
if (svc->id == id && !strncmp(svc->cmd, cmd, strlen(svc->cmd))) {
|
if (svc->id == id && !strncmp(svc->cmd, cmd, strlen(svc->cmd)))
|
||||||
_d("Found a matching svc for %s", cmd);
|
|
||||||
return svc;
|
return svc;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user