summaryrefslogtreecommitdiffhomepage
path: root/netifd.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-16 00:42:29 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-16 00:42:29 +0200
commitb314737e9a0f0df710ba5e8691882cd7d42faaf5 (patch)
tree39e8cae5647d9323b8d9c01201fce18466a2fc3d /netifd.h
parent6b3f6f4466e5584f2bdefc55b3ca34186b65acb9 (diff)
detach stdin/stdout/stderr from child processes, implement a separate logging pipe and relay log messages with prefix
Diffstat (limited to 'netifd.h')
-rw-r--r--netifd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/netifd.h b/netifd.h
index 4129af7..316c746 100644
--- a/netifd.h
+++ b/netifd.h
@@ -44,6 +44,8 @@ enum {
#define D(level, format, ...) no_debug(DEBUG_ ## level, format, ## __VA_ARGS__)
#endif
+#define LOG_BUF_SIZE 256
+
static inline void no_debug(int level, const char *fmt, ...)
{
}
@@ -59,6 +61,13 @@ struct netifd_process {
struct uloop_process uloop;
void (*cb)(struct netifd_process *, int ret);
int dir_fd;
+
+ struct netifd_fd log_fd;
+ struct uloop_fd log_uloop;
+ const char *log_prefix;
+ char *log_buf;
+ int log_buf_ofs;
+ bool log_overflow;
};
int netifd_start_process(const char **argv, char **env, struct netifd_process *proc);