libxl: fix unitialized variables in libxl__primary_console_find
authorOlaf Hering <olaf@aepfle.de>
Wed, 1 Aug 2012 11:46:49 +0000 (12:46 +0100)
committerOlaf Hering <olaf@aepfle.de>
Wed, 1 Aug 2012 11:46:49 +0000 (12:46 +0100)
commitfe074860b5daaa6e0943a92209c999bf476c0ce6
tree743f6e5f62296a0f6e2bb57ec0cbee9dcf733711
parent14b47731eaad8472858b712ee3899b3d15e24b92
libxl: fix unitialized variables in libxl__primary_console_find

gcc 4.5 as shipped with openSuSE 11.4 does not recognize the case of
LIBXL_DOMAIN_TYPE_INVALID properly:

cc1: warnings being treated as errors
libxl.c: In function 'libxl_primary_console_exec':
libxl.c:1408:14: error: 'domid' may be used uninitialized in this function
libxl.c:1409:9: error: 'cons_num' may be used uninitialized in this function
libxl.c:1410:24: error: 'type' may be used uninitialized in this function
libxl.c: In function 'libxl_primary_console_get_tty':
libxl.c:1421:14: error: 'domid' may be used uninitialized in this function
libxl.c:1422:9: error: 'cons_num' may be used uninitialized in this function
libxl.c:1423:24: error: 'type' may be used uninitialized in this function
make[3]: *** [libxl.o] Error 1

Fix this by adding a default case.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c