chiark / gitweb /
machinectl: fix warning when compiling with -Og
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 1 Nov 2013 19:54:29 +0000 (20:54 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 1 Nov 2013 19:54:29 +0000 (20:54 +0100)
src/machine/machinectl.c: In function ‘openpt_in_namespace’:
src/machine/machinectl.c:623:44: warning: ‘master’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                         close_nointr_nofail(master);
                                            ^

src/machine/machinectl.c

index 7a252c3..5a6bb05 100644 (file)
@@ -528,7 +528,7 @@ static int openpt_in_namespace(pid_t pid, int flags) {
                 uint8_t buf[CMSG_SPACE(sizeof(int))];
         } control;
         struct cmsghdr *cmsg;
-        int master, r;
+        int master = -1, r;
         pid_t child;
         siginfo_t si;