diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-02-07 20:31:19 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-02-07 20:31:19 +0000 |
commit | 31cf8e00563a399768db0edda94ce1358e386dfa (patch) | |
tree | 63215d88f4f83e023ca889ff97545fe6d6df2686 /sysklogd | |
parent | 79ac30da83dfb16babbfc6d450a421f91752b3c8 (diff) | |
download | busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.tar.gz busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.tar.bz2 busybox-w32-31cf8e00563a399768db0edda94ce1358e386dfa.zip |
device_open is common code -- moved into utility.c
-Erik
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/syslogd.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 29ede13db..c48d5a435 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -68,25 +68,6 @@ static const char syslogd_usage[] = | |||
68 | "\t-O\tSpecify an alternate log file. default=/var/log/messages\n"; | 68 | "\t-O\tSpecify an alternate log file. default=/var/log/messages\n"; |
69 | 69 | ||
70 | 70 | ||
71 | /* try to open up the specified device */ | ||
72 | static int device_open(char *device, int mode) | ||
73 | { | ||
74 | int m, f, fd = -1; | ||
75 | |||
76 | m = mode | O_NONBLOCK; | ||
77 | |||
78 | /* Retry up to 5 times */ | ||
79 | for (f = 0; f < 5; f++) | ||
80 | if ((fd = open(device, m, 0600)) >= 0) | ||
81 | break; | ||
82 | if (fd < 0) | ||
83 | return fd; | ||
84 | /* Reset original flags. */ | ||
85 | if (m != mode) | ||
86 | fcntl(fd, F_SETFL, mode); | ||
87 | return fd; | ||
88 | } | ||
89 | |||
90 | /* print a message to the log file */ | 71 | /* print a message to the log file */ |
91 | static void message(char *fmt, ...) | 72 | static void message(char *fmt, ...) |
92 | { | 73 | { |