X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.h;h=80f1a38b57452e3aa67ecf7c85518c3139489b6f;hb=4dba533a137486719fb385c45fc2ff75593fdf53;hp=b469009bf7e151da121beb6e103f90236f1d3b28;hpb=799fd0fd23028a58e1f605c6b0d9aaab65b4fb1f;p=elogind.git diff --git a/src/util.h b/src/util.h index b469009bf..80f1a38b5 100644 --- a/src/util.h +++ b/src/util.h @@ -267,9 +267,6 @@ char *format_timespan(char *buf, size_t l, usec_t t); int make_stdio(int fd); int make_null_stdio(void); -bool is_clean_exit(int code, int status); -bool is_clean_exit_lsb(int code, int status); - unsigned long long random_ull(void); #define DEFINE_STRING_TABLE_LOOKUP(name,type) \ @@ -334,7 +331,12 @@ void sigset_add_many(sigset_t *ss, ...); char* gethostname_malloc(void); char* getlogname_malloc(void); -int getttyname_malloc(char **r); + +int getttyname_malloc(int fd, char **r); +int getttyname_harder(int fd, char **r); + +int get_ctty_devnr(dev_t *d); +int get_ctty(char **r); int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid); @@ -355,6 +357,7 @@ char *ellipsize(const char *s, unsigned length, unsigned percent); int touch(const char *path); char *unquote(const char *s, const char *quotes); +char *normalize_env_assignment(const char *s); int wait_for_terminate(pid_t pid, siginfo_t *status); int wait_for_terminate_and_warn(const char *name, pid_t pid); @@ -363,14 +366,23 @@ _noreturn_ void freeze(void); bool null_or_empty(struct stat *st); -DIR *xopendirat(int dirfd, const char *name); - -int ask_password_tty(const char *message, usec_t until, const char *flag_file, char **_passphrase); +DIR *xopendirat(int dirfd, const char *name, int flags); void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t); void dual_timestamp_deserialize(const char *value, dual_timestamp *t); -#define NULSTR_FOREACH(i, l) \ +char *fstab_node_to_udev_node(const char *p); + +void filter_environ(const char *prefix); + +bool tty_is_vc(const char *tty); +const char *default_term_for_tty(const char *tty); + +bool running_in_vm(void); + +void execute_directory(const char *directory, DIR *_d, char *argv[]); + +#define NULSTR_FOREACH(i, l) \ for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) #define NULSTR_FOREACH_PAIR(i, j, l) \