[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v4 2/3] libxl: localtime(3) can return NULL
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- v4: add logging --- tools/libxl/libxl_x86.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index 8cd15ca..ce14a73 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -311,6 +311,12 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, t = time(NULL); tm = localtime(&t); + if (!tm) { + LOG(ERROR, "Failed to call localtime"); + ret = ERROR_FAIL; + goto out; + } + rtc_timeoffset += tm->tm_gmtoff; } @@ -335,6 +341,7 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, } } +out: return ret; } -- 1.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |