diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-11-29 14:10:00 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-11-30 09:53:47 +0100 |
commit | 1542738826dd0ed26cfc8f5e2e37ffe80f1b9676 (patch) | |
tree | 7eb7a6bfdb7f4217449741942253c2115e6ad5d7 /system.c | |
parent | 501c6d70a6a7357652e2a4fb1ad5856d90bde29b (diff) | |
download | unitd-1542738826dd0ed26cfc8f5e2e37ffe80f1b9676.tar unitd-1542738826dd0ed26cfc8f5e2e37ffe80f1b9676.zip |
Rename to unitd, clean up CMakeLists.txt
Diffstat (limited to 'system.c')
-rw-r--r-- | system.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1,7 +1,9 @@ /* + * Copyright (C) 2015 Matthias Schiffer <mschiffer@universe-factory.net> + * + * Based on "procd" by: * Copyright (C) 2013 Felix Fietkau <nbd@openwrt.org> * Copyright (C) 2013 John Crispin <blogic@openwrt.org> - * Copyright (C) 2015 Matthias Schiffer <mschiffer@universe-factory.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1 @@ -25,7 +27,7 @@ #include <libubox/uloop.h> -#include "procd.h" +#include "unitd.h" #include "watchdog.h" static struct blob_buf b; @@ -338,7 +340,7 @@ static const struct blobmsg_policy nand_policy[__NAND_MAX] = { }; static void -procd_spawn_upgraded(char *path) +unitd_spawn_upgraded(char *path) { char *wdt_fd = watchdog_fd(); char *argv[] = { "/tmp/upgraded", NULL, NULL}; @@ -366,13 +368,13 @@ static int nand_set(struct ubus_context *ctx, struct ubus_object *obj, if (!tb[NAND_PATH]) return UBUS_STATUS_INVALID_ARGUMENT; - procd_spawn_upgraded(blobmsg_get_string(tb[NAND_PATH])); + unitd_spawn_upgraded(blobmsg_get_string(tb[NAND_PATH])); fprintf(stderr, "Yikees, something went wrong. no /sbin/upgraded ?\n"); return 0; } static void -procd_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj) +unitd_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj) { notify = obj->has_subscribers; } @@ -397,11 +399,11 @@ static struct ubus_object system_object = { .type = &system_object_type, .methods = system_methods, .n_methods = ARRAY_SIZE(system_methods), - .subscribe_cb = procd_subscribe_cb, + .subscribe_cb = unitd_subscribe_cb, }; void -procd_bcast_event(char *event, struct blob_attr *msg) +unitd_bcast_event(char *event, struct blob_attr *msg) { int ret; |