chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit: add minimal condition checker for unit startup
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index 85ee09d1422ed33cca8bec09e8fb4774cbf9ed30..d09e44777671b298f02eac2f1f7beea3152e1891 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-3313,6
+3313,18
@@
void freeze(void) {
pause();
}
pause();
}
+bool null_or_empty(struct stat *st) {
+ assert(st);
+
+ if (S_ISREG(st->st_mode) && st->st_size <= 0)
+ return true;
+
+ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+ return true;
+
+ return false;
+}
+
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",