chiark / gitweb /
aquire_terminal(): fix uninitialized variable
authorKay Sievers <kay@vrfy.org>
Sun, 15 Jul 2012 13:34:22 +0000 (15:34 +0200)
committerKay Sievers <kay@vrfy.org>
Sun, 15 Jul 2012 13:34:22 +0000 (15:34 +0200)
./src/shared/util.c:2457:45: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]

src/shared/util.c

index 845b4bf8241cf427678dc0d576bbc5bf97431c1c..cef6dbb732f48201c3c26fc21e2804dfd24e6c56 100644 (file)
@@ -2385,7 +2385,7 @@ int acquire_terminal(
                 bool ignore_tiocstty_eperm,
                 usec_t timeout) {
 
                 bool ignore_tiocstty_eperm,
                 usec_t timeout) {
 
-        int fd = -1, notify = -1, r, wd = -1;
+        int fd = -1, notify = -1, r = 0, wd = -1;
         usec_t ts = 0;
         struct sigaction sa_old, sa_new;
 
         usec_t ts = 0;
         struct sigaction sa_old, sa_new;