chiark / gitweb /
journalctl: Unify boot id lookup into common function get_boots
[elogind.git] / src / udev / udev-rules.c
index ce4d173ee9db4286984f5bc38a4ebf49f86ead36..3bc25f7c26980f4f1b2f62ecd6880536fadbc9a8 100644 (file)
@@ -1072,8 +1072,7 @@ static int add_rule(struct udev_rules *rules, char *line,
                                 _cleanup_free_ char *tmp;
 
                                 tmp = cescape(buf);
-                                log_error("invalid key/value pair in file %s on line %u,"
-                                          "starting at character %tu ('%s')\n",
+                                log_error("invalid key/value pair in file %s on line %u, starting at character %tu ('%s')\n",
                                           filename, lineno, linepos - line + 1, tmp);
                                 if (linepos[1] == '#')
                                         log_error("hint: comments can only start at beginning of line");
@@ -1576,7 +1575,7 @@ invalid:
 }
 
 static int parse_file(struct udev_rules *rules, const char *filename) {
-        FILE *f;
+        _cleanup_fclose_ FILE *f = NULL;
         unsigned int first_token;
         unsigned int filename_off;
         char line[UTIL_LINE_SIZE];
@@ -1634,7 +1633,6 @@ static int parse_file(struct udev_rules *rules, const char *filename) {
                 }
                 add_rule(rules, key, filename, filename_off, line_nr);
         }
-        fclose(f);
 
         /* link GOTOs to LABEL rules in this file to be able to fast-forward */
         for (i = first_token+1; i < rules->token_cur; i++) {