From: Chris Lalancette Date: Tue, 6 Apr 2010 19:33:32 +0000 (-0400) Subject: Fix build of openvz on RHEL-5. X-Git-Tag: v0.8.1~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29045d88ed12775edf355b51ea61ff3f2856fd14;p=thirdparty%2Flibvirt.git Fix build of openvz on RHEL-5. When building libvirt on RHEL-5, I saw this error: cc1: warnings being treated as errors openvz/openvz_conf.c: In function 'openvzGetVPSUUID': openvz/openvz_conf.c:835: warning: 'saveptr' may be used uninitialized in this function make[3]: *** [libvirt_driver_openvz_la-openvz_conf.lo] Error 1 gcc in RHEL-5 gets upset about this usage of strtok_r (even though it is perfectly valid). Just set *saveptr to NULL at the start to quiet it down. Signed-off-by: Chris Lalancette --- diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 51567d4037..8735cc10a7 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -832,7 +832,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len) { char conf_file[PATH_MAX]; char line[1024]; - char *saveptr; + char *saveptr = NULL; char *uuidbuf; char *iden; int fd, ret;