if (!ret) {
time_t timestamp = imagetool_get_source_date(cmdname,
time(NULL));
+ uint32_t t = cpu_to_uimage(timestamp);
- ret = fit_set_timestamp(fit, noffset, timestamp);
+ ret = fdt_setprop(fit, noffset, FIT_TIMESTAMP_PROP, &t,
+ sizeof(uint32_t));
}
if (region_prop && !ret) {
uint32_t strdata[2];
/* Check that we have read all the file */
if (n != sbuf.st_size) {
- printf("Can't read all file %s (read %zd bytes, expexted %lld)\n",
+ printf("Can't read all file %s (read %zd bytes, expected %lld)\n",
filename, n, (long long)sbuf.st_size);
goto err;
}
{
unsigned char *tmp = data;
struct timespec date;
- int i, ret = 0;
+ int i, ret;
if (!tmp) {
printf("%s: pointer data is NULL\n", __func__);
}
ret = clock_gettime(CLOCK_MONOTONIC, &date);
- if (ret < 0) {
- printf("%s: clock_gettime has failed (err=%d, str=%s)\n",
- __func__, ret, strerror(errno));
+ if (ret) {
+ printf("%s: clock_gettime has failed (%s)\n", __func__,
+ strerror(errno));
goto out;
}