chiark / gitweb /
util: make gcc shut up
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Apr 2010 14:39:07 +0000 (16:39 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Apr 2010 14:39:07 +0000 (16:39 +0200)
util.c
util.h

diff --git a/util.c b/util.c
index 03c60af..4382699 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1133,7 +1133,7 @@ int close_all_fds(const int except[], unsigned n_except) {
                 return -errno;
 
         while ((de = readdir(d))) {
-                int fd;
+                int fd = -1;
 
                 if (de->d_name[0] == '.')
                         continue;
diff --git a/util.h b/util.h
index af39acc..d0fd66d 100644 (file)
--- a/util.h
+++ b/util.h
@@ -163,7 +163,7 @@ bool ignore_file(const char *filename);
         }                                                               \
         type name##_from_string(const char *s) {                        \
                 type i;                                                 \
-                unsigned u;                                             \
+                unsigned u = 0;                                         \
                 assert(s);                                              \
                 for (i = 0; i < (type)ELEMENTSOF(name##_table); i++)    \
                         if (streq(name##_table[i], s))                  \