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

This commit is contained in:
Matthias Bolte 2011-05-13 07:07:13 +02:00
parent 95cc5e5908
commit cded0c80b0
5 changed files with 9 additions and 9 deletions

View File

@ -9183,7 +9183,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
def->name = virXPathString("string(./name)", ctxt);
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) {
virReportOOMError();
@ -9193,8 +9193,8 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
def->description = virXPathString("string(./description)", ctxt);
if (!newSnapshot) {
if (virXPathLong("string(./creationTime)", ctxt,
&def->creationTime) < 0) {
if (virXPathLongLong("string(./creationTime)", ctxt,
&def->creationTime) < 0) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing creationTime from existing snapshot"));
goto cleanup;
@ -9259,7 +9259,7 @@ char *virDomainSnapshotDefFormat(char *domain_uuid,
virBufferAsprintf(&buf, " <name>%s</name>\n", def->parent);
virBufferAddLit(&buf, " </parent>\n");
}
virBufferAsprintf(&buf, " <creationTime>%ld</creationTime>\n",
virBufferAsprintf(&buf, " <creationTime>%lld</creationTime>\n",
def->creationTime);
virBufferAddLit(&buf, " <domain>\n");
virBufferAsprintf(&buf, " <uuid>%s</uuid>\n", domain_uuid);

View File

@ -1042,7 +1042,7 @@ struct _virDomainSnapshotDef {
char *name;
char *description;
char *parent;
time_t creationTime;
long long creationTime; /* in seconds */
int state;
long active;

View File

@ -1402,7 +1402,7 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
int
esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
time_t *secondsSinceEpoch)
long long *secondsSinceEpoch)
{
char value[64] = "";
char *tmp;

View File

@ -264,7 +264,7 @@ int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element,
virBufferPtr output);
int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime);
int esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
time_t *secondsSinceEpoch);
long long *secondsSinceEpoch);

View File

@ -169,7 +169,7 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
struct testDateTime {
const char *dateTime;
time_t calendarTime;
long long calendarTime;
};
static struct testDateTime times[] = {
@ -205,7 +205,7 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
{
int i;
esxVI_DateTime dateTime;
time_t calendarTime;
long long calendarTime;
for (i = 0; i < ARRAY_CARDINALITY(times); ++i) {
dateTime.value = (char *)times[i].dateTime;