chiark / gitweb /
install: make sure that --root= mode doesn't make us consider all units outside of...
[elogind.git] / src / shared / util.h
index 5a2f10387e2a063b8217b185b5d3b0b4c3857df5..73f7c0ad4cbc801d698a6d584975d238edc8a3b4 100644 (file)
@@ -543,7 +543,6 @@ int glob_extend(char ***strv, const char *path);
 
 int dirent_ensure_type(DIR *d, struct dirent *de);
 
-int in_search_path(const char *path, char **search);
 int get_files_in_directory(const char *path, char ***list);
 
 char *strjoin(const char *x, ...) _sentinel_;
@@ -672,6 +671,13 @@ _malloc_  _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_t b)
         return malloc(a * b);
 }
 
+_alloc_(2, 3) static inline void *realloc_multiply(void *p, size_t a, size_t b) {
+        if (_unlikely_(b != 0 && a > ((size_t) -1) / b))
+                return NULL;
+
+        return realloc(p, a * b);
+}
+
 _alloc_(2, 3) static inline void *memdup_multiply(const void *p, size_t a, size_t b) {
         if (_unlikely_(b != 0 && a > ((size_t) -1) / b))
                 return NULL;