mirror of https://github.com/vitalif/e2fsprogs
blkid: fix blkid time diff bug
When calculating time diffs, use difftime() instead of risking integer overflow. Also build a "blkid" binary. Addresses-Google-Bug: #11175082 Change-Id: I23521f45204574bb32f152926401c2cbad93175b Signed-off-by: Theodore Ts'o <tytso@mit.edu>debian
parent
5efe492d19
commit
62bc8d19bd
|
@ -1532,14 +1532,15 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
|
|||
unsigned char *buf;
|
||||
const char *type, *value;
|
||||
struct stat st;
|
||||
time_t diff, now;
|
||||
time_t now;
|
||||
double diff;
|
||||
int idx;
|
||||
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
now = time(0);
|
||||
diff = now - dev->bid_time;
|
||||
diff = difftime(now, dev->bid_time);
|
||||
|
||||
if (stat(dev->bid_name, &st) < 0) {
|
||||
DBG(DEBUG_PROBE,
|
||||
|
|
Loading…
Reference in New Issue