projects
/
project
/
netifd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
apply device settings to simple devices with config specified from the interface...
[project/netifd.git]
/
main.c
diff --git
a/main.c
b/main.c
index
02fd9ff
..
eeefd52
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-23,14
+23,6
@@
static struct list_head fds = LIST_HEAD_INIT(fds);
#define DEFAULT_LOG_LEVEL L_NOTICE
#define DEFAULT_LOG_LEVEL L_NOTICE
-enum {
- L_CRIT,
- L_WARNING,
- L_NOTICE,
- L_INFO,
- L_DEBUG
-};
-
static int log_level = DEFAULT_LOG_LEVEL;
static const int log_class[] = {
[L_CRIT] = LOG_CRIT,
static int log_level = DEFAULT_LOG_LEVEL;
static const int log_class[] = {
[L_CRIT] = LOG_CRIT,
@@
-94,12
+86,14
@@
netifd_process_log_cb(struct uloop_fd *fd, unsigned int events)
retry:
read_len = len = read(fd->fd, buf, maxlen);
retry:
read_len = len = read(fd->fd, buf, maxlen);
- if (len <
=
0) {
- if (errno == E
INTR
)
+ if (len < 0) {
+ if (errno == E
AGAIN
)
goto retry;
goto retry;
- return;
- }
+ goto out;
+ } else if (len == 0)
+ goto out;
+
proc->log_buf_ofs += len;
cur = buf;
proc->log_buf_ofs += len;
cur = buf;
@@
-134,6
+128,10
@@
retry:
if (read_len == maxlen)
goto retry;
if (read_len == maxlen)
goto retry;
+
+out:
+ if (fd->eof)
+ uloop_fd_delete(fd);
}
static void
}
static void