[systemd-commits] 2 commits - src/journal src/shared
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Dec 10 11:52:40 PST 2013
src/journal/journald-stream.c | 8 +-------
src/shared/hashmap.c | 8 +++++---
2 files changed, 6 insertions(+), 10 deletions(-)
New commits:
commit 65a6df56f136ed3977f7fcd688f62a25371506fa
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Dec 10 19:52:16 2013 +0000
hashmap: make gcc shut up on old glibcs that lack getauxval()
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index 8f5957b..3762e3a 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -185,7 +185,6 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
bool b;
Hashmap *h;
size_t size;
- void *auxv;
b = is_main_thread();
@@ -222,8 +221,11 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
* rehash everything using a new random XOR mask from
* /dev/random. */
#ifdef HAVE_SYS_AUXV_H
- auxv = (void*) getauxval(AT_RANDOM);
- h->random_xor = auxv ? *(unsigned*) auxv : random_u();
+ {
+ void *auxv;
+ auxv = (void*) getauxval(AT_RANDOM);
+ h->random_xor = auxv ? *(unsigned*) auxv : random_u();
+ }
#else
h->random_xor = random_u();
#endif
commit 14c1025934e709d07948c13ca62b40c35c91d111
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Dec 10 19:51:47 2013 +0000
journald: use a bit more cleanup magic!
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 091f59d..42a846b 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -76,7 +76,7 @@ struct StdoutStream {
static int stdout_stream_log(StdoutStream *s, const char *p) {
struct iovec iovec[N_IOVEC_META_FIELDS + 5];
- char *message = NULL, *syslog_priority = NULL, *syslog_facility = NULL, *syslog_identifier = NULL;
+ _cleanup_free_ char *message = NULL, *syslog_priority = NULL, *syslog_facility = NULL, *syslog_identifier = NULL;
unsigned n = 0;
int priority;
char *label = NULL;
@@ -129,12 +129,6 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
#endif
server_dispatch_message(s->server, iovec, n, ELEMENTSOF(iovec), &s->ucred, NULL, label, label_len, s->unit_id, priority, 0);
-
- free(message);
- free(syslog_priority);
- free(syslog_facility);
- free(syslog_identifier);
-
return 0;
}
More information about the systemd-commits
mailing list