Merge pull request #19302 from bluca/uninit
tree-wide: avoid uninitialized warning on _cleanup_ variables
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user