chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mount: also relabel pre-mounted API dirs
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index 1febd073d2eeef37f9e7ecf99179ae711a7acbdd..2a5f3074b650f0cf538256c4eb10e9b11f924637 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-61,6
+61,20
@@
#include "exit-status.h"
#include "hashmap.h"
#include "exit-status.h"
#include "hashmap.h"
+size_t page_size(void) {
+ static __thread size_t pgsz = 0;
+ long r;
+
+ if (pgsz)
+ return pgsz;
+
+ assert_se((r = sysconf(_SC_PAGESIZE)) > 0);
+
+ pgsz = (size_t) r;
+
+ return pgsz;
+}
+
bool streq_ptr(const char *a, const char *b) {
/* Like streq(), but tries to make sense of NULL pointers */
bool streq_ptr(const char *a, const char *b) {
/* Like streq(), but tries to make sense of NULL pointers */
@@
-3568,7
+3582,6
@@
char *normalize_env_assignment(const char *s) {
free(p);
if (!value) {
free(p);
if (!value) {
- free(p);
free(name);
return NULL;
}
free(name);
return NULL;
}
@@
-4174,6
+4187,10
@@
bool nulstr_contains(const char*nulstr, const char *needle) {
return false;
}
return false;
}
+bool plymouth_running(void) {
+ return access("/run/plymouth/pid", F_OK) >= 0;
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",
@@
-4194,7
+4211,7
@@
static const char *const sigchld_code_table[] = {
DEFINE_STRING_TABLE_LOOKUP(sigchld_code, int);
DEFINE_STRING_TABLE_LOOKUP(sigchld_code, int);
-static const char *const log_facility_table[LOG_NFACILITIES] = {
+static const char *const log_facility_
unshifted_
table[LOG_NFACILITIES] = {
[LOG_FAC(LOG_KERN)] = "kern",
[LOG_FAC(LOG_USER)] = "user",
[LOG_FAC(LOG_MAIL)] = "mail",
[LOG_FAC(LOG_KERN)] = "kern",
[LOG_FAC(LOG_USER)] = "user",
[LOG_FAC(LOG_MAIL)] = "mail",
@@
-4217,7
+4234,7
@@
static const char *const log_facility_table[LOG_NFACILITIES] = {
[LOG_FAC(LOG_LOCAL7)] = "local7"
};
[LOG_FAC(LOG_LOCAL7)] = "local7"
};
-DEFINE_STRING_TABLE_LOOKUP(log_facility, int);
+DEFINE_STRING_TABLE_LOOKUP(log_facility
_unshifted
, int);
static const char *const log_level_table[] = {
[LOG_EMERG] = "emerg",
static const char *const log_level_table[] = {
[LOG_EMERG] = "emerg",