chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: stop the service if ExecStartPost ends with a failure
[elogind.git]
/
src
/
util.h
diff --git
a/src/util.h
b/src/util.h
index 3e1f46d82697d7aea47eb377924074bf0d03a1f3..a71a297eab6b56740efe070d3473dd3118b183f3 100644
(file)
--- a/
src/util.h
+++ b/
src/util.h
@@
-288,13
+288,13
@@
int make_null_stdio(void);
unsigned long long random_ull(void);
unsigned long long random_ull(void);
-#define
DEFINE_STRING_TABLE_LOOKUP(name,type)
\
-
const char *name##_to_string(type i) {
\
+#define
__DEFINE_STRING_TABLE_LOOKUP(name,type,scope)
\
+
scope const char *name##_to_string(type i) {
\
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
return NULL; \
return name##_table[i]; \
} \
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
return NULL; \
return name##_table[i]; \
} \
-
type name##_from_string(const char *s) {
\
+
scope type name##_from_string(const char *s) {
\
type i; \
unsigned u = 0; \
assert(s); \
type i; \
unsigned u = 0; \
assert(s); \
@@
-309,6
+309,8
@@
unsigned long long random_ull(void);
} \
struct __useless_struct_to_allow_trailing_semicolon__
} \
struct __useless_struct_to_allow_trailing_semicolon__
+#define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,)
+#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,static)
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
@@
-404,10
+406,6
@@
bool tty_is_vc(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
-int detect_vm(const char **id);
-int detect_container(const char **id);
-int detect_virtualization(const char **id);
-
void execute_directory(const char *directory, DIR *_d, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
void execute_directory(const char *directory, DIR *_d, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
@@
-469,6
+467,8
@@
int block_get_whole_disk(dev_t d, dev_t *ret);
int file_is_sticky(const char *p);
int file_is_sticky(const char *p);
+int strdup_or_null(const char *a, char **b);
+
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
@@
-506,4
+506,6
@@
extern char **saved_argv;
bool kexec_loaded(void);
bool kexec_loaded(void);
+unsigned long cap_last_cap(void);
+
#endif
#endif