summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <sven.eden@prydeworx.com>2018-11-08 07:53:08 +0100
committerSven Eden <sven.eden@prydeworx.com>2018-11-08 08:02:57 +0100
commitb3ced55dae5e496d5e8741ca5e4fb5a4ba62a9a3 (patch)
tree8e61e8fb72686800e106e1cf40bf00e4558cab9a
parent0300d4f6e98ae9c3cf65ce6719b3b4111e384621 (diff)
Prep v239.2: Fix migration errors in basic
-rw-r--r--src/basic/hashmap.c2
-rw-r--r--src/basic/mempool.c4
-rw-r--r--src/basic/mempool.h2
-rw-r--r--src/basic/missing.h10
-rw-r--r--src/basic/proc-cmdline.c4
-rw-r--r--src/basic/socket-util.c2
-rw-r--r--src/basic/string-util.h2
-rw-r--r--src/basic/util.c4
-rw-r--r--src/basic/util.h2
9 files changed, 18 insertions, 14 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index 2bee671..40ae2c3 100644
--- a/src/basic/hashmap.c
+++ b/src/basic/hashmap.c
@@ -7,7 +7,7 @@
#include "alloc-util.h"
#include "fileio.h"
-//#include "hashmap.h"
+#include "hashmap.h"
#include "macro.h"
#include "mempool.h"
#include "process-util.h"
diff --git a/src/basic/mempool.c b/src/basic/mempool.c
index 24a7d2b..159c963 100644
--- a/src/basic/mempool.c
+++ b/src/basic/mempool.c
@@ -3,10 +3,10 @@
#include <stdint.h>
#include <stdlib.h>
-//#include "env-util.h"
+#include "env-util.h"
#include "macro.h"
#include "mempool.h"
-//#include "process-util.h"
+#include "process-util.h"
#include "util.h"
struct pool {
diff --git a/src/basic/mempool.h b/src/basic/mempool.h
index a9d6b46..0eecca0 100644
--- a/src/basic/mempool.h
+++ b/src/basic/mempool.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-//#include <stdbool.h>
+#include <stdbool.h>
#include <stddef.h>
struct pool;
diff --git a/src/basic/missing.h b/src/basic/missing.h
index 7b267a2..37d1c2a 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -15,20 +15,17 @@
#include <linux/neighbour.h>
#include <linux/oom.h>
#include <linux/rtnetlink.h>
-//#include <linux/stat.h>
#include <net/ethernet.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/socket.h>
-//#include <sys/stat.h>
+#include <sys/stat.h>
#include <sys/syscall.h>
#include <uchar.h>
#include <unistd.h>
-/// Additional includes needed by elogind
-#include "musl_missing.h"
-#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H
#if WANT_LINUX_STAT_H
+#include <linux/stat.h>
#endif
#if HAVE_AUDIT
@@ -60,6 +57,9 @@ struct sockaddr_vm {
};
#endif /* !HAVE_LINUX_VM_SOCKETS_H */
+/// Additional includes needed by elogind
+#include "musl_missing.h"
+
#ifndef RLIMIT_RTTIME
#define RLIMIT_RTTIME 15
#endif
diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c
index ab8cab7..67da8d3 100644
--- a/src/basic/proc-cmdline.c
+++ b/src/basic/proc-cmdline.c
@@ -61,11 +61,15 @@ int proc_cmdline_parse_given(const char *line, proc_cmdline_parse_t parse_item,
/* Filter out arguments that are intended only for the initrd */
q = startswith(word, "rd.");
if (q) {
+#if 0 /// elogind is never in initrd. Doesn't make any sense.
if (!in_initrd())
continue;
if (flags & PROC_CMDLINE_STRIP_RD_PREFIX)
key = q;
+#else
+ continue;
+#endif // 0
}
value = strchr(key, '=');
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 9fa638c..dcc3a54 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -1205,7 +1205,6 @@ int socket_ioctl_fd(void) {
return fd;
}
-#endif // 0
int sockaddr_un_unlink(const struct sockaddr_un *sa) {
const char *p, * nul;
@@ -1230,3 +1229,4 @@ int sockaddr_un_unlink(const struct sockaddr_un *sa) {
return 1;
}
+#endif // 0
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 46760cb..61d0d03 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -236,6 +236,7 @@ static inline void *memory_startswith(const void *p, size_t sz, const char *toke
return (uint8_t*) p + n;
}
+#if 0 /// Not needed by elogind, only test-string-util uses this.
/* Like startswith_no_case(), but operates on arbitrary memory blocks.
* It works only for ASCII strings.
*/
@@ -257,3 +258,4 @@ static inline void *memory_startswith_no_case(const void *p, size_t sz, const ch
return (uint8_t*) p + n;
}
+#endif // 0
diff --git a/src/basic/util.c b/src/basic/util.c
index 6f3f505..f00bf30 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -49,7 +49,9 @@
int saved_argc = 0;
char **saved_argv = NULL;
+#if 0 /// UNNEEDED by elogind
static int saved_in_initrd = -1;
+#endif // 0
size_t page_size(void) {
static thread_local size_t pgsz = 0;
@@ -132,7 +134,6 @@ int prot_from_flags(int flags) {
return -EINVAL;
}
}
-#endif // 0
bool in_initrd(void) {
struct statfs s;
@@ -165,7 +166,6 @@ bool in_initrd(void) {
return saved_in_initrd;
}
-#if 0 /// UNNEEDED by elogind
void in_initrd_force(bool value) {
saved_in_initrd = value;
}
diff --git a/src/basic/util.h b/src/basic/util.h
index ff21a99..8e8ef68 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -69,10 +69,8 @@ extern char **saved_argv;
bool kexec_loaded(void);
int prot_from_flags(int flags) _const_;
-#endif // 0
bool in_initrd(void);
-#if 0 /// UNNEEDED by elogind
void in_initrd_force(bool value);
void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,