chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import: introduce new mini-daemon systemd-importd, and make machinectl a client to it
[elogind.git]
/
src
/
shared
/
util.h
diff --git
a/src/shared/util.h
b/src/shared/util.h
index 84453713caebd2f164a498aa12a5f251eb1ab6d0..bb2c101569f40adf8e001cbb2ed756ad772c496d 100644
(file)
--- a/
src/shared/util.h
+++ b/
src/shared/util.h
@@
-651,7
+651,10
@@
int setrlimit_closest(int resource, const struct rlimit *rlim);
int getenv_for_pid(pid_t pid, const char *field, char **_value);
int getenv_for_pid(pid_t pid, const char *field, char **_value);
-bool is_valid_documentation_url(const char *url) _pure_;
+bool http_url_is_valid(const char *url) _pure_;
+bool documentation_url_is_valid(const char *url) _pure_;
+
+bool http_etag_is_valid(const char *etag);
bool in_initrd(void);
bool in_initrd(void);
@@
-664,13
+667,6
@@
static inline void freep(void *p) {
free(*(void**) p);
}
free(*(void**) p);
}
-#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
- static inline void func##p(type *p) { \
- if (*p) \
- func(*p); \
- } \
- struct __useless_struct_to_allow_trailing_semicolon__
-
static inline void closep(int *fd) {
safe_close(*fd);
}
static inline void closep(int *fd) {
safe_close(*fd);
}
@@
-993,6
+989,7
@@
union file_handle_union {
struct file_handle handle;
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
};
struct file_handle handle;
char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
};
+#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ }
int update_reboot_param_file(const char *param);
int update_reboot_param_file(const char *param);
@@
-1068,3
+1065,10
@@
void release_lock_file(LockFile *f);
#define LOCK_FILE_INIT { .fd = -1, .path = NULL }
#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
#define LOCK_FILE_INIT { .fd = -1, .path = NULL }
#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
+
+ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
+
+void sigkill_wait(pid_t *pid);
+#define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)
+
+int syslog_parse_priority(const char **p, int *priority, bool with_facility);