chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: make gcc shut up
[elogind.git]
/
util.h
diff --git
a/util.h
b/util.h
index 772d7ae9ffb82a40d44f0c6296012a9fd3693bc2..d0fd66dda4d71a75ffa6d84a709aa44c578a9f7a 100644
(file)
--- a/
util.h
+++ b/
util.h
@@
-163,10
+163,14
@@
bool ignore_file(const char *filename);
} \
type name##_from_string(const char *s) { \
type i; \
} \
type name##_from_string(const char *s) { \
type i; \
+ unsigned u = 0; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
if (streq(name##_table[i], s)) \
return i; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
if (streq(name##_table[i], s)) \
return i; \
+ if (safe_atou(s, &u) >= 0 && \
+ u < ELEMENTSOF(name##_table)) \
+ return (type) u; \
return (type) -1; \
} \
struct __useless_struct_to_allow_trailing_semicolon__
return (type) -1; \
} \
struct __useless_struct_to_allow_trailing_semicolon__
@@
-175,6
+179,10
@@
bool ignore_file(const char *filename);
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);
+int close_all_fds(const int except[], unsigned n_except);
+
+extern char * __progname;
+
const char *ioprio_class_to_string(int i);
int ioprio_class_from_string(const char *s);
const char *ioprio_class_to_string(int i);
int ioprio_class_from_string(const char *s);