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 03c60af98daa527222c87214cb14d60edc6c1a9b..43826990cd702244cb67e5881da6a98e74f2c4b6 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))) {
                 return -errno;
 
         while ((de = readdir(d))) {
-                int fd;
+                int fd = -1;
 
                 if (de->d_name[0] == '.')
                         continue;
 
                 if (de->d_name[0] == '.')
                         continue;
diff --git a/util.h b/util.h
index af39accc946c47c079ace7164f9e65c38d7f86db..d0fd66dda4d71a75ffa6d84a709aa44c578a9f7a 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;                                                 \
         }                                                               \
         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))                  \
                 assert(s);                                              \
                 for (i = 0; i < (type)ELEMENTSOF(name##_table); i++)    \
                         if (streq(name##_table[i], s))                  \