summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-08-15 09:01:47 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit95ddf8036d90ed95e4087b2a3aef3f9dc9561e1b (patch)
treee5f701e5c631f2e2cdb49bc3e9cf37c481c14481
parentad31ae9ed41c3d3b42f78958aa7bc9b58e877b28 (diff)
Prep v239: Uncomment header inclusions that are new or needed now.
-rw-r--r--cb/elogind.cbp6
-rw-r--r--src/basic/conf-files.c6
-rw-r--r--src/basic/conf-files.h2
-rw-r--r--src/basic/copy.c2
-rw-r--r--src/basic/fd-util.c4
-rw-r--r--src/basic/format-table.c2
-rw-r--r--src/basic/mkdir.c3
-rw-r--r--src/basic/parse-util.c4
-rw-r--r--src/basic/process-util.c2
-rw-r--r--src/basic/rm-rf.c2
-rw-r--r--src/basic/smack-util.c6
-rw-r--r--src/basic/smack-util.h2
-rw-r--r--src/basic/string-util.c2
-rw-r--r--src/libelogind/sd-event/test-event.c14
-rw-r--r--src/login/loginctl.c4
-rw-r--r--src/login/logind-action.h2
-rw-r--r--src/login/logind-dbus.c9
-rw-r--r--src/login/pam_elogind.c2
-rw-r--r--src/test/test-bus-util.c4
-rw-r--r--src/test/test-conf-files.c4
-rw-r--r--src/test/test-conf-parser.c6
-rw-r--r--src/test/test-ellipsize.c4
-rw-r--r--src/test/test-parse-util.c2
-rw-r--r--src/test/test-signal-util.c12
-rw-r--r--src/test/test-string-util.c4
25 files changed, 50 insertions, 60 deletions
diff --git a/cb/elogind.cbp b/cb/elogind.cbp
index 077aa055c..f6c6a6667 100644
--- a/cb/elogind.cbp
+++ b/cb/elogind.cbp
@@ -392,7 +392,6 @@
<Option target="clean" />
</Unit>
<Unit filename="../src/basic/mount-util.c">
- <Option compilerVar="CC" />
<Option target="all" />
<Option target="clean" />
</Unit>
@@ -1246,11 +1245,6 @@
<Option target="all" />
<Option target="clean" />
</Unit>
- <Unit filename="../src/shared/udev-util.c">
- <Option compilerVar="CC" />
- <Option target="all" />
- <Option target="clean" />
- </Unit>
<Unit filename="../src/shared/udev-util.h">
<Option target="all" />
<Option target="clean" />
diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c
index 5801d5409..6960a0bce 100644
--- a/src/basic/conf-files.c
+++ b/src/basic/conf-files.c
@@ -8,7 +8,7 @@
#include <string.h>
#include "conf-files.h"
-//#include "def.h"
+#include "def.h"
#include "dirent-util.h"
#include "fd-util.h"
#include "hashmap.h"
@@ -16,7 +16,7 @@
#include "macro.h"
#include "missing.h"
#include "path-util.h"
-//#include "set.h"
+#include "set.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
@@ -333,6 +333,7 @@ int conf_files_list_with_replacement(
return 0;
}
+#if 0 /// UNNEEDED by elogind
int conf_files_cat(const char *root, const char *name) {
_cleanup_strv_free_ char **dirs = NULL, **files = NULL;
_cleanup_free_ char *path = NULL;
@@ -365,3 +366,4 @@ int conf_files_cat(const char *root, const char *name) {
/* show */
return cat_files(path, files, CAT_FLAGS_MAIN_FILE_OPTIONAL);
}
+#endif // 0
diff --git a/src/basic/conf-files.h b/src/basic/conf-files.h
index 9da03ed22..16fcc5736 100644
--- a/src/basic/conf-files.h
+++ b/src/basic/conf-files.h
@@ -21,4 +21,6 @@ int conf_files_list_with_replacement(
const char *replacement,
char ***files,
char **replace_file);
+#if 0 /// UNNEEDED by elogind
int conf_files_cat(const char *root, const char *name);
+#endif // 0
diff --git a/src/basic/copy.c b/src/basic/copy.c
index 1b1e512b8..aaefc3a51 100644
--- a/src/basic/copy.c
+++ b/src/basic/copy.c
@@ -3,7 +3,7 @@
//#include <dirent.h>
//#include <errno.h>
//#include <fcntl.h>
-//#include <stddef.h>
+#include <stddef.h>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c
index 9ea102c0f..1efd83b7f 100644
--- a/src/basic/fd-util.c
+++ b/src/basic/fd-util.c
@@ -7,8 +7,8 @@
#include <sys/stat.h>
#include <unistd.h>
-//#include "alloc-util.h"
-//#include "copy.h"
+#include "alloc-util.h"
+#include "copy.h"
#include "dirent-util.h"
#include "fd-util.h"
#include "fileio.h"
diff --git a/src/basic/format-table.c b/src/basic/format-table.c
index c967642df..6c079bf8d 100644
--- a/src/basic/format-table.c
+++ b/src/basic/format-table.c
@@ -13,7 +13,7 @@
//#include "terminal-util.h"
//#include "time-util.h"
//#include "utf8.h"
-//#include "util.h"
+#include "util.h"
#define DEFAULT_WEIGHT 100
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
index 29d31831e..9e9c172f9 100644
--- a/src/basic/mkdir.c
+++ b/src/basic/mkdir.c
@@ -11,13 +11,12 @@
#include "mkdir.h"
#include "path-util.h"
#include "stat-util.h"
-//#include "stdio-util.h"
+#include "stdio-util.h"
#include "user-util.h"
/// Additional includes needed by elogind
#include "missing.h"
-int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, bool follow_symlink, mkdir_func_t _mkdir) {
int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir) {
struct stat st;
int r;
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index f33e12a74..3935d8a3e 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -6,14 +6,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-//#include <sys/socket.h>
+#include <sys/socket.h>
#include "alloc-util.h"
#include "errno-list.h"
//#include "extract-word.h"
#include "locale-util.h"
#include "macro.h"
-//#include "missing.h"
+#include "missing.h"
#include "parse-util.h"
#include "process-util.h"
#include "string-util.h"
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 7064cc453..77d76958c 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
-//#include <sys/mount.h>
+#include <sys/mount.h>
#include <sys/personality.h>
#include <sys/prctl.h>
#include <sys/types.h>
diff --git a/src/basic/rm-rf.c b/src/basic/rm-rf.c
index cb69abca6..1b0de8bd0 100644
--- a/src/basic/rm-rf.c
+++ b/src/basic/rm-rf.c
@@ -8,7 +8,7 @@
#include <sys/statfs.h>
#include <unistd.h>
-//#include "alloc-util.h"
+#include "alloc-util.h"
//#include "btrfs-util.h"
#include "cgroup-util.h"
#include "dirent-util.h"
diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
index 2b63eee83..8c82d008c 100644
--- a/src/basic/smack-util.c
+++ b/src/basic/smack-util.c
@@ -6,21 +6,21 @@
***/
#include <errno.h>
-//#include <fcntl.h>
+#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/xattr.h>
#include <unistd.h>
#include "alloc-util.h"
-//#include "fd-util.h"
+#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "macro.h"
#include "path-util.h"
#include "process-util.h"
#include "smack-util.h"
-//#include "stdio-util.h"
+#include "stdio-util.h"
#include "string-table.h"
#include "xattr-util.h"
diff --git a/src/basic/smack-util.h b/src/basic/smack-util.h
index 2a9773f32..2424d479e 100644
--- a/src/basic/smack-util.h
+++ b/src/basic/smack-util.h
@@ -10,7 +10,7 @@
#include <stdbool.h>
#include <sys/types.h>
-//#include "label.h"
+#include "label.h"
#include "macro.h"
#define SMACK_FLOOR_LABEL "_"
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index 7abbfe0c4..0f43b3744 100644
--- a/src/basic/string-util.c
+++ b/src/basic/string-util.c
@@ -17,7 +17,7 @@
//#include "terminal-util.h"
#include "utf8.h"
#include "util.h"
-//#include "fileio.h"
+#include "fileio.h"
int strcmp_ptr(const char *a, const char *b) {
diff --git a/src/libelogind/sd-event/test-event.c b/src/libelogind/sd-event/test-event.c
index 2eb022362..13dcf6ab9 100644
--- a/src/libelogind/sd-event/test-event.c
+++ b/src/libelogind/sd-event/test-event.c
@@ -6,18 +6,18 @@
#include "sd-event.h"
-//#include "alloc-util.h"
+#include "alloc-util.h"
#include "fd-util.h"
-//#include "fileio.h"
-//#include "fs-util.h"
+#include "fileio.h"
+#include "fs-util.h"
#include "log.h"
#include "macro.h"
-//#include "parse-util.h"
+#include "parse-util.h"
//#include "process-util.h"
-//#include "rm-rf.h"
+#include "rm-rf.h"
#include "signal-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
+#include "stdio-util.h"
+#include "string-util.h"
#include "util.h"
/// Additional includes needed by elogind
#include "process-util.h"
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 3553abd0d..9eef701b0 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -14,7 +14,7 @@
#include "bus-util.h"
//#include "cgroup-show.h"
#include "cgroup-util.h"
-//#include "format-table.h"
+#include "format-table.h"
#include "log.h"
//#include "logs-show.h"
#include "macro.h"
@@ -24,7 +24,7 @@
#include "sigbus.h"
#include "signal-util.h"
#include "spawn-polkit-agent.h"
-//#include "string-table.h"
+#include "string-table.h"
#include "strv.h"
#include "sysfs-show.h"
#include "terminal-util.h"
diff --git a/src/login/logind-action.h b/src/login/logind-action.h
index c1421193b..a45aab785 100644
--- a/src/login/logind-action.h
+++ b/src/login/logind-action.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-//#include "conf-parser.h"
+#include "conf-parser.h"
typedef enum HandleAction {
HANDLE_IGNORE,
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index f9d0b1c9f..31acd57dc 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2338,11 +2338,11 @@ static int method_can_shutdown_or_sleep(
if (sleep_verb) {
#if 0 /// elogind needs to have the manager being passed
r = can_sleep(sleep_verb);
- if (IN_SET(r, 0, -ENOSPC))
- return sd_bus_reply_method_return(message, "s", "na");
#else
r = can_sleep(m, sleep_verb);
#endif // 0
+ if (IN_SET(r, 0, -ENOSPC))
+ return sd_bus_reply_method_return(message, "s", "na");
if (r < 0)
return r;
}
@@ -2385,6 +2385,10 @@ static int method_can_shutdown_or_sleep(
}
#endif // 0
}
+#else
+ if ( (handle <= HANDLE_IGNORE) || (handle >= _HANDLE_ACTION_MAX) ) {
+ result = "no";
+ goto finish;
}
if (multiple_sessions) {
@@ -2430,6 +2434,7 @@ static int method_can_shutdown_or_sleep(
}
finish:
+
return sd_bus_reply_method_return(message, "s", result);
}
diff --git a/src/login/pam_elogind.c b/src/login/pam_elogind.c
index f9c5398f1..88c5705ef 100644
--- a/src/login/pam_elogind.c
+++ b/src/login/pam_elogind.c
@@ -30,7 +30,7 @@
#include "terminal-util.h"
#include "util.h"
#include "path-util.h"
-//#include "cgroup-util.h"
+#include "cgroup-util.h"
static int parse_argv(
pam_handle_t *handle,
diff --git a/src/test/test-bus-util.c b/src/test/test-bus-util.c
index a320a0d78..23cd60226 100644
--- a/src/test/test-bus-util.c
+++ b/src/test/test-bus-util.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-//#include "bus-util.h"
-//#include "log.h"
+#include "bus-util.h"
+#include "log.h"
static void test_name_async(unsigned n_messages) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c
index a9b78450b..2ec2dfc26 100644
--- a/src/test/test-conf-files.c
+++ b/src/test/test-conf-files.c
@@ -8,10 +8,10 @@
#include "alloc-util.h"
#include "conf-files.h"
-//#include "fileio.h"
+#include "fileio.h"
#include "fs-util.h"
#include "macro.h"
-//#include "mkdir.h"
+#include "mkdir.h"
#include "parse-util.h"
#include "rm-rf.h"
#include "string-util.h"
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c
index a8df45941..3cce425e6 100644
--- a/src/test/test-conf-parser.c
+++ b/src/test/test-conf-parser.c
@@ -3,17 +3,13 @@
#include "conf-parser.h"
#include "fd-util.h"
#include "fileio.h"
-//#include "fs-util.h"
+#include "fs-util.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"
#include "util.h"
-/// Additional includes needed by elogind
-#include "fd-util.h"
-#include "fileio.h"
-
static void test_config_parse_path_one(const char *rvalue, const char *expected) {
_cleanup_free_ char *path = NULL;
diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c
index 5e0c7577f..92692bd48 100644
--- a/src/test/test-ellipsize.c
+++ b/src/test/test-ellipsize.c
@@ -5,10 +5,10 @@
#include "alloc-util.h"
#include "def.h"
#include "string-util.h"
-//#include "strv.h"
+#include "strv.h"
#include "terminal-util.h"
#include "util.h"
-//#include "utf8.h"
+#include "utf8.h"
static void test_ellipsize_mem_one(const char *s, size_t old_length, size_t new_length) {
_cleanup_free_ char *n = NULL;
diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
index 73688952f..19e1ed477 100644
--- a/src/test/test-parse-util.c
+++ b/src/test/test-parse-util.c
@@ -3,7 +3,7 @@
#include <errno.h>
#include <locale.h>
#include <math.h>
-//#include <sys/socket.h>
+#include <sys/socket.h>
#include "alloc-util.h"
#include "errno-list.h"
diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c
index d78d368c0..9387d5804 100644
--- a/src/test/test-signal-util.c
+++ b/src/test/test-signal-util.c
@@ -6,17 +6,9 @@
//#include "log.h"
#include "macro.h"
#include "signal-util.h"
+#include "stdio-util.h"
+#include "string-util.h"
/// Additional includes needed by elogind
-//#include "stdio-util.h"
-//#include "string-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
-//#include "stdio-util.h"
-//#include "string-util.h"
#include "process-util.h"
#define info(sig) log_info(#sig " = " STRINGIFY(sig) " = %d", sig)
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c
index 47032729e..a9e322f0c 100644
--- a/src/test/test-string-util.c
+++ b/src/test/test-string-util.c
@@ -1,11 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include "alloc-util.h"
-//#include "locale-util.h"
+#include "locale-util.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"
-//#include "utf8.h"
+#include "utf8.h"
static void test_string_erase(void) {
char *x;