summaryrefslogtreecommitdiffstats
path: root/lib/event_counter.c
diff options
context:
space:
mode:
authorwhitespace / reindent <invalid@invalid.invalid>2017-07-17 14:03:14 +0200
committerwhitespace / reindent <invalid@invalid.invalid>2017-07-17 14:04:07 +0200
commitd62a17aedeb0eebdba98238874bb13d62c48dbf9 (patch)
tree3b319b1d61c8b85b4d1f06adf8b844bb8a9b5107 /lib/event_counter.c
parent*: add indent control files (diff)
downloadfrr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.tar.xz
frr-d62a17aedeb0eebdba98238874bb13d62c48dbf9.zip
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/event_counter.c')
-rw-r--r--lib/event_counter.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/lib/event_counter.c b/lib/event_counter.c
index 0acd0a1f7..c520937a3 100644
--- a/lib/event_counter.c
+++ b/lib/event_counter.c
@@ -44,29 +44,28 @@
#include "event_counter.h"
-void
-event_counter_inc (struct event_counter *counter)
+void event_counter_inc(struct event_counter *counter)
{
- counter->count++;
- counter->last = time (NULL);
+ counter->count++;
+ counter->last = time(NULL);
}
-const char *
-event_counter_format (const struct event_counter *counter)
+const char *event_counter_format(const struct event_counter *counter)
{
- struct tm last_change_store;
- struct tm *last_change;
- char timebuf[sizeof ("Thu, 01 Jan 1970 00:00:00 +0000")];
- static char rv[20 + sizeof (" last: ") + sizeof (timebuf)];
+ struct tm last_change_store;
+ struct tm *last_change;
+ char timebuf[sizeof("Thu, 01 Jan 1970 00:00:00 +0000")];
+ static char rv[20 + sizeof(" last: ") + sizeof(timebuf)];
- last_change = localtime_r (&counter->last, &last_change_store);
- if (!last_change || strftime (timebuf, sizeof (timebuf),
- "%a, %d %b %Y %T %z", last_change) == 0)
- {
- strncpy (timebuf, "???", sizeof (timebuf));
- }
+ last_change = localtime_r(&counter->last, &last_change_store);
+ if (!last_change
+ || strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %T %z",
+ last_change)
+ == 0) {
+ strncpy(timebuf, "???", sizeof(timebuf));
+ }
- snprintf (rv, sizeof (rv), "%5llu last: %s", counter->count,
- counter->last ? timebuf : "(never)");
- return rv;
+ snprintf(rv, sizeof(rv), "%5llu last: %s", counter->count,
+ counter->last ? timebuf : "(never)");
+ return rv;
}