diff options
author | Shawn Landden <shawnlandden@gmail.com> | 2013-08-21 18:20:55 -0700 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-08-22 00:52:14 -0400 |
commit | 2a0e0692565f0435657c93498e09cbb2d3517152 (patch) | |
tree | d5fb3d6352aed75b11b2e38dc65486016ff88357 /src/journal | |
parent | 67c15b9a7ac016ac5c9b885756b2eaa7f44a0509 (diff) |
remove hasprefix(), use startswith()
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journal-send.c | 2 | ||||
-rw-r--r-- | src/journal/journald-native.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index fef66fc29a..d00e26f1eb 100644 --- a/src/journal/journal-send.c +++ b/src/journal/journal-send.c @@ -245,7 +245,7 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { have_syslog_identifier = have_syslog_identifier || (c == (char *) iov[i].iov_base + 17 && - hasprefix(iov[i].iov_base, "SYSLOG_IDENTIFIER")); + startswith(iov[i].iov_base, "SYSLOG_IDENTIFIER")); nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len); if (nl) { diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c index 0f9af378cf..c50cf64f5c 100644 --- a/src/journal/journald-native.c +++ b/src/journal/journald-native.c @@ -154,23 +154,23 @@ void server_process_native_message( * of this entry for the rate limiting * logic */ if (l == 10 && - hasprefix(p, "PRIORITY=") && + startswith(p, "PRIORITY=") && p[9] >= '0' && p[9] <= '9') priority = (priority & LOG_FACMASK) | (p[9] - '0'); else if (l == 17 && - hasprefix(p, "SYSLOG_FACILITY=") && + startswith(p, "SYSLOG_FACILITY=") && p[16] >= '0' && p[16] <= '9') priority = (priority & LOG_PRIMASK) | ((p[16] - '0') << 3); else if (l == 18 && - hasprefix(p, "SYSLOG_FACILITY=") && + startswith(p, "SYSLOG_FACILITY=") && p[16] >= '0' && p[16] <= '9' && p[17] >= '0' && p[17] <= '9') priority = (priority & LOG_PRIMASK) | (((p[16] - '0')*10 + (p[17] - '0')) << 3); else if (l >= 19 && - hasprefix(p, "SYSLOG_IDENTIFIER=")) { + startswith(p, "SYSLOG_IDENTIFIER=")) { char *t; t = strndup(p + 18, l - 18); @@ -179,7 +179,7 @@ void server_process_native_message( identifier = t; } } else if (l >= 8 && - hasprefix(p, "MESSAGE=")) { + startswith(p, "MESSAGE=")) { char *t; t = strndup(p + 8, l - 8); @@ -189,7 +189,7 @@ void server_process_native_message( } } else if (l > strlen("OBJECT_PID=") && l < strlen("OBJECT_PID=") + DECIMAL_STR_MAX(pid_t) && - hasprefix(p, "OBJECT_PID=") && + startswith(p, "OBJECT_PID=") && allow_object_pid(ucred)) { char buf[DECIMAL_STR_MAX(pid_t)]; memcpy(buf, p + strlen("OBJECT_PID="), l - strlen("OBJECT_PID=")); |