Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162631131
D52697.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52697.diff
View Options
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -309,7 +309,6 @@
static void savelog(char *from, char *to);
static void createdir(const struct conf_entry *ent, char *dirpart);
static void createlog(const struct conf_entry *ent);
-static int parse_signal(const char *str);
/*
* All the following take a parameter of 'int', but expect values in the
@@ -1485,8 +1484,7 @@
working->sig = SIGHUP;
if (q && *q) {
got_sig:
- working->sig = parse_signal(q);
- if (working->sig < 1 || working->sig >= sys_nsig) {
+ if (str2sig(q, &working->sig) != 0) {
badline(
"illegal signal in config file:\n%s",
errline);
@@ -2884,28 +2882,3 @@
warn("can't chflags %s NODUMP", fname);
}
}
-
-/*
- * Parse a signal number or signal name. Returns the signal number parsed or -1
- * on failure.
- */
-static int
-parse_signal(const char *str)
-{
- int sig, i;
- const char *errstr;
-
- sig = strtonum(str, 1, sys_nsig - 1, &errstr);
-
- if (errstr == NULL)
- return (sig);
- if (strncasecmp(str, "SIG", 3) == 0)
- str += 3;
-
- for (i = 1; i < sys_nsig; i++) {
- if (strcasecmp(str, sys_signame[i]) == 0)
- return (i);
- }
-
- return (-1);
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 16, 6:45 AM (6 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35126949
Default Alt Text
D52697.diff (1 KB)
Attached To
Mode
D52697: newsyslog: use str2sig() instead of own implementation
Attached
Detach File
Event Timeline
Log In to Comment