]> git.michaelhowe.org Git - packages/o/openafs.git/commit
rework afs_random() yet again
authorBenjamin Kaduk <kaduk@mit.edu>
Sun, 3 Feb 2019 01:45:31 +0000 (19:45 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sun, 26 Jan 2020 17:55:18 +0000 (12:55 -0500)
commitf5f44ca2efa3534e84a5311fec7a637ec7bf5d9b
tree6a373fbabbfb15afb55ab4befb4bc2e363eb9300
parent1b704df8db4c7e2191b3683c03590aeb663af2f8
rework afs_random() yet again

clang 7 notes that ~0 is signed and that left-shifting into the sign
bit is undefined behvaior.  Use a new construction to clear the low
byte of tv_usec with only bitwise operations that are independent of
the width of tv_usec and stay within the realm of C's defined behavior.

Reviewed-on: https://gerrit.openafs.org/13474
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f0a3d477d6109697645cfdcc17617b502349d91b)

Change-Id: I4f0438c2fc8237968f41409ca23ac098839508fe
Reviewed-on: https://gerrit.openafs.org/13743
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/afs_server.c