提交 cded0c80 编写于 作者: M Matthias Bolte

time_t is not a long on FreeBSD, switch internal type to long long

上级 95cc5e59
...@@ -9183,7 +9183,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr, ...@@ -9183,7 +9183,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
def->name = virXPathString("string(./name)", ctxt); def->name = virXPathString("string(./name)", ctxt);
if (def->name == NULL) if (def->name == NULL)
ignore_value(virAsprintf(&def->name, "%ld", tv.tv_sec)); ignore_value(virAsprintf(&def->name, "%lld", (long long)tv.tv_sec));
if (def->name == NULL) { if (def->name == NULL) {
virReportOOMError(); virReportOOMError();
...@@ -9193,8 +9193,8 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr, ...@@ -9193,8 +9193,8 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
def->description = virXPathString("string(./description)", ctxt); def->description = virXPathString("string(./description)", ctxt);
if (!newSnapshot) { if (!newSnapshot) {
if (virXPathLong("string(./creationTime)", ctxt, if (virXPathLongLong("string(./creationTime)", ctxt,
&def->creationTime) < 0) { &def->creationTime) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s", virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing creationTime from existing snapshot")); _("missing creationTime from existing snapshot"));
goto cleanup; goto cleanup;
...@@ -9259,7 +9259,7 @@ char *virDomainSnapshotDefFormat(char *domain_uuid, ...@@ -9259,7 +9259,7 @@ char *virDomainSnapshotDefFormat(char *domain_uuid,
virBufferAsprintf(&buf, " <name>%s</name>\n", def->parent); virBufferAsprintf(&buf, " <name>%s</name>\n", def->parent);
virBufferAddLit(&buf, " </parent>\n"); virBufferAddLit(&buf, " </parent>\n");
} }
virBufferAsprintf(&buf, " <creationTime>%ld</creationTime>\n", virBufferAsprintf(&buf, " <creationTime>%lld</creationTime>\n",
def->creationTime); def->creationTime);
virBufferAddLit(&buf, " <domain>\n"); virBufferAddLit(&buf, " <domain>\n");
virBufferAsprintf(&buf, " <uuid>%s</uuid>\n", domain_uuid); virBufferAsprintf(&buf, " <uuid>%s</uuid>\n", domain_uuid);
......
...@@ -1042,7 +1042,7 @@ struct _virDomainSnapshotDef { ...@@ -1042,7 +1042,7 @@ struct _virDomainSnapshotDef {
char *name; char *name;
char *description; char *description;
char *parent; char *parent;
time_t creationTime; long long creationTime; /* in seconds */
int state; int state;
long active; long active;
......
...@@ -1402,7 +1402,7 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime) ...@@ -1402,7 +1402,7 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
int int
esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime, esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
time_t *secondsSinceEpoch) long long *secondsSinceEpoch)
{ {
char value[64] = ""; char value[64] = "";
char *tmp; char *tmp;
......
...@@ -264,7 +264,7 @@ int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element, ...@@ -264,7 +264,7 @@ int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element,
virBufferPtr output); virBufferPtr output);
int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime); int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime);
int esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime, int esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
time_t *secondsSinceEpoch); long long *secondsSinceEpoch);
......
...@@ -169,7 +169,7 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED) ...@@ -169,7 +169,7 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
struct testDateTime { struct testDateTime {
const char *dateTime; const char *dateTime;
time_t calendarTime; long long calendarTime;
}; };
static struct testDateTime times[] = { static struct testDateTime times[] = {
...@@ -205,7 +205,7 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED) ...@@ -205,7 +205,7 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
{ {
int i; int i;
esxVI_DateTime dateTime; esxVI_DateTime dateTime;
time_t calendarTime; long long calendarTime;
for (i = 0; i < ARRAY_CARDINALITY(times); ++i) { for (i = 0; i < ARRAY_CARDINALITY(times); ++i) {
dateTime.value = (char *)times[i].dateTime; dateTime.value = (char *)times[i].dateTime;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册