chiark / gitweb /
remove duplicate semicolons
[elogind.git] / src / delta / delta.c
index 1a5b08a7d09e8c7283e26f6e26de62aeefcd278b..494e82eb989c449ee27906da472ae56a6a3ae676 100644 (file)
@@ -176,11 +176,12 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, const char *path) {
         }
 
         for (;;) {
-                struct dirent *de, buf;
+                struct dirent *de;
+                union dirent_storage buf;
                 int k;
                 char *p;
 
-                k = readdir_r(d, &buf, &de);
+                k = readdir_r(d, &buf.de, &de);
                 if (k != 0) {
                         r = -k;
                         goto finish;
@@ -192,7 +193,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, const char *path) {
                 if (!dirent_is_file(de))
                         continue;
 
-                p = join(path, "/", de->d_name, NULL);
+                p = strjoin(path, "/", de->d_name, NULL);
                 if (!p) {
                         r = -ENOMEM;
                         goto finish;
@@ -231,7 +232,7 @@ finish:
 static int process_suffix(const char *prefixes, const char *suffix) {
         const char *p;
         char *f;
-        Hashmap *top, *bottom;
+        Hashmap *top, *bottom=NULL;
         int r = 0, k;
         Iterator i;
         int n_found = 0;
@@ -254,7 +255,7 @@ static int process_suffix(const char *prefixes, const char *suffix) {
         NULSTR_FOREACH(p, prefixes) {
                 char *t;
 
-                t = join(p, "/", suffix, NULL);
+                t = strjoin(p, "/", suffix, NULL);
                 if (!t) {
                         r = -ENOMEM;
                         goto finish;
@@ -307,7 +308,7 @@ static int process_suffix_chop(const char *prefixes, const char *suffix) {
         /* Strip prefix from the suffix */
         NULSTR_FOREACH(p, prefixes) {
                 if (startswith(suffix, p)) {
-                        suffix += strlen(p);;
+                        suffix += strlen(p);
                         suffix += strspn(suffix, "/");
                         return process_suffix(prefixes, suffix);
                 }
@@ -453,8 +454,8 @@ int main(int argc, char *argv[]) {
                 "binfmt.d\0"
                 "systemd/system\0"
                 "systemd/user\0"
-                "systemd/system.preset\0"
-                "systemd/user.preset\0"
+                "systemd/system-preset\0"
+                "systemd/user-preset\0"
                 "udev/rules.d\0"
                 "modprobe.d\0";