Merge pull request #19302 from bluca/uninit

tree-wide: avoid uninitialized warning on _cleanup_ variables
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-04-14 16:25:35 +02:00
committed by GitHub
63 changed files with 118 additions and 112 deletions
+1 -1
View File
@@ -88,7 +88,7 @@ static void patch_realtime(
}
static int journal_file_empty(int dir_fd, const char *name) {
_cleanup_close_ int fd;
_cleanup_close_ int fd = -1;
struct stat st;
le64_t n_entries;
ssize_t n;
+1 -1
View File
@@ -1860,7 +1860,7 @@ static int add_current_paths(sd_journal *j) {
* treat them as fatal. */
ORDERED_HASHMAP_FOREACH(f, j->files) {
_cleanup_free_ char *dir;
_cleanup_free_ char *dir = NULL;
int r;
dir = dirname_malloc(f->path);
+1 -1
View File
@@ -775,7 +775,7 @@ _public_ int sd_get_sessions(char ***sessions) {
}
_public_ int sd_get_uids(uid_t **users) {
_cleanup_closedir_ DIR *d;
_cleanup_closedir_ DIR *d = NULL;
struct dirent *de;
int r = 0;
unsigned n = 0;