chiark / gitweb /
gitignore: update
[elogind.git] / src / shared / util.h
index 52c33238b1ce5123274852984caf42fb39d72c7c..485733f65074475842237571af8d669d130f7421 100644 (file)
@@ -329,6 +329,7 @@ ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
 bool is_device_path(const char *path);
 
 int dir_is_empty(const char *path);
+char* dirname_malloc(const char *path);
 
 void rename_process(const char name[8]);
 
@@ -594,7 +595,7 @@ int create_tmp_dir(char template[], char** dir_name);
 #define FOREACH_DIRENT(de, d, on_error)                                 \
         for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
                 if (!de) {                                              \
-                        if (errno != 0) {                               \
+                        if (errno > 0) {                                \
                                 on_error;                               \
                         }                                               \
                         break;                                          \