diff options
author | Martin Natano <natano@cvs.openbsd.org> | 2016-10-22 10:13:09 +0000 |
---|---|---|
committer | Martin Natano <natano@cvs.openbsd.org> | 2016-10-22 10:13:09 +0000 |
commit | 0d90227113b249d64bb6e7955fc60bacf4ae0d71 (patch) | |
tree | 8d556b26e43a79e96aa9c0893bde041db367b08c /usr.sbin | |
parent | a8a0a34795f8adeb4ca91de8279ea858c4cb42bc (diff) |
Use deterministic pseudo-random numbers when the -T flag is used; for
repeatable builds.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/makefs/ffs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index ee4932ef31b..86267a59ee1 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.c,v 1.10 2016/10/18 17:23:21 natano Exp $ */ +/* $OpenBSD: ffs.c,v 1.11 2016/10/22 10:13:08 natano Exp $ */ /* $NetBSD: ffs.c,v 1.66 2015/12/21 00:58:08 christos Exp $ */ /* @@ -494,12 +494,13 @@ ffs_create_image(const char *image, fsinfo_t *fsopts) if (debug & DEBUG_FS_CREATE_IMAGE) printf("calling mkfs(\"%s\", ...)\n", image); - if (stampst.st_ino == 1) + if (stampst.st_ino == 1) { tstamp = stampst.st_ctime; - else + srandom_deterministic(tstamp); + } else { tstamp = start_time.tv_sec; - - srandom(tstamp); + srandom(tstamp); + } fs = ffs_mkfs(image, fsopts, tstamp); fsopts->superblock = (void *)fs; |