random(6): Re-add undocumented support for floating point denominatorsAnd document it in the manual page.PR: 244139Submitted by: Keith White <kwhite AT site.uottawa.ca> (earlier version)
random(6): Fix off-by-oneAfter r355693, random(6) -f sometimes fail to output all the lines of theinput file. This is because the range from which random indices are chosenis too big, so occasio
random(6): Fix off-by-oneAfter r355693, random(6) -f sometimes fail to output all the lines of theinput file. This is because the range from which random indices are chosenis too big, so occasionally the random selection doesn't correspond to anyline and nothing gets printed.(Ed. note: Mea culpa. Working on r355693, I was confused by the sometimeuse of 1-indexing, sometimes 0-indexing in randomize_fd().)Submitted by: Ryan Moeller <ryan AT freqlabs.com>X-MFC-With: r355693Sponsored by: iXsystems, Inc.Differential Revision: https://reviews.freebsd.org/D23199
show more ...
random(6): produce random resultsThis program is trash and there's no reason to keep it in base. But as long aswe're shipping a silly program named 'random', let's actually make it random.
DIRDEPS_BUILD: Update dependencies.Sponsored by: Dell EMC Isilon
Fix a (false positive?) Argument cannot be negative coverity defect.Rather than guarding close(fd) with an fd >= 0 test and setting fdto -1 when it is closed to avoid a potential double-close, jus
Fix a (false positive?) Argument cannot be negative coverity defect.Rather than guarding close(fd) with an fd >= 0 test and setting fdto -1 when it is closed to avoid a potential double-close, justmove the close() call after the conditional "goto make_token". Thismoves the close() call totally outside the loop to avoid thepossibility of calling it twice. This should also prevent a Coveritywarning about checking fd for validity after it was previously passedto read().Reported by: CoverityCID: 1355335MFC after: 1 weekX-MFC with: r299484
random(6): Fix double-closeIn the case where a file lacks a trailing newline, there is some "evil" code toreverse goto the tokenizing code ("make_token") for the final token in thefile. In this
random(6): Fix double-closeIn the case where a file lacks a trailing newline, there is some "evil" code toreverse goto the tokenizing code ("make_token") for the final token in thefile. In this case, 'fd' is closed more than once. Use a negative sentinelvalue to guard close(2), preventing the double close.Ideally, this code would be restructured to avoid this ugly construction.Reported by: CoverityCID: 1006123Sponsored by: EMC / Isilon Storage Division
Final step of eliminating the "games" distribution: Merge src/games(or what's left of it, at least) into src/usr.bin.This change will not be MFCed.Discussed at: EuroBSDCon 2014Committed from:
Final step of eliminating the "games" distribution: Merge src/games(or what's left of it, at least) into src/usr.bin.This change will not be MFCed.Discussed at: EuroBSDCon 2014Committed from: EuroBSDCon 2015