History log of /freebsd-10-stable/games/random/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
307403 16-Oct-2016 sevan

MFC r267667:
use .Mt to mark up email addresses consistently (part1)

PR: 191174
Submitted by: Franco Fichtner <franco at lastsummer.de>


/freebsd-10-stable/bin/chio/chio.1
/freebsd-10-stable/bin/freebsd-version/freebsd-version.1
/freebsd-10-stable/bin/pkill/pkill.1
/freebsd-10-stable/bin/setfacl/setfacl.1
/freebsd-10-stable/games/morse/morse.6
random.6
/freebsd-10-stable/sbin/adjkerntz/adjkerntz.8
/freebsd-10-stable/sbin/atm/atmconfig/atmconfig.8
/freebsd-10-stable/sbin/camcontrol/camcontrol.8
/freebsd-10-stable/sbin/dhclient/dhclient-script.8
/freebsd-10-stable/sbin/dhclient/dhclient.8
/freebsd-10-stable/sbin/dhclient/dhclient.conf.5
/freebsd-10-stable/sbin/dhclient/dhclient.leases.5
/freebsd-10-stable/sbin/dhclient/dhcp-options.5
/freebsd-10-stable/sbin/ffsinfo/ffsinfo.8
/freebsd-10-stable/sbin/fsirand/fsirand.8
/freebsd-10-stable/sbin/gbde/gbde.8
/freebsd-10-stable/sbin/geom/class/cache/gcache.8
/freebsd-10-stable/sbin/geom/class/concat/gconcat.8
/freebsd-10-stable/sbin/geom/class/eli/geli.8
/freebsd-10-stable/sbin/geom/class/journal/gjournal.8
/freebsd-10-stable/sbin/geom/class/label/glabel.8
/freebsd-10-stable/sbin/geom/class/mirror/gmirror.8
/freebsd-10-stable/sbin/geom/class/mountver/gmountver.8
/freebsd-10-stable/sbin/geom/class/multipath/gmultipath.8
/freebsd-10-stable/sbin/geom/class/nop/gnop.8
/freebsd-10-stable/sbin/geom/class/part/gpart.8
/freebsd-10-stable/sbin/geom/class/raid/graid.8
/freebsd-10-stable/sbin/geom/class/raid3/graid3.8
/freebsd-10-stable/sbin/geom/class/sched/gsched.8
/freebsd-10-stable/sbin/geom/class/shsec/gshsec.8
/freebsd-10-stable/sbin/geom/class/stripe/gstripe.8
/freebsd-10-stable/sbin/geom/class/virstor/gvirstor.8
/freebsd-10-stable/sbin/geom/core/geom.8
/freebsd-10-stable/sbin/ggate/ggatec/ggatec.8
/freebsd-10-stable/sbin/ggate/ggated/ggated.8
/freebsd-10-stable/sbin/ggate/ggatel/ggatel.8
/freebsd-10-stable/sbin/growfs/growfs.8
/freebsd-10-stable/sbin/gvinum/gvinum.8
/freebsd-10-stable/sbin/hastctl/hastctl.8
/freebsd-10-stable/sbin/hastd/hast.conf.5
/freebsd-10-stable/sbin/hastd/hastd.8
/freebsd-10-stable/sbin/ipfw/ipfw.8
/freebsd-10-stable/sbin/kldconfig/kldconfig.8
/freebsd-10-stable/sbin/kldload/kldload.8
/freebsd-10-stable/sbin/kldstat/kldstat.8
/freebsd-10-stable/sbin/kldunload/kldunload.8
/freebsd-10-stable/sbin/md5/md5.1
/freebsd-10-stable/sbin/mdconfig/mdconfig.8
/freebsd-10-stable/sbin/mount/mount.conf.8
/freebsd-10-stable/sbin/mount_cd9660/mount_cd9660.8
/freebsd-10-stable/sbin/mount_msdosfs/mount_msdosfs.8
/freebsd-10-stable/sbin/mount_unionfs/mount_unionfs.8
/freebsd-10-stable/sbin/natd/natd.8
/freebsd-10-stable/sbin/newfs_msdos/newfs_msdos.8
/freebsd-10-stable/sbin/newfs_nandfs/newfs_nandfs.8
/freebsd-10-stable/sbin/nos-tun/nos-tun.8
/freebsd-10-stable/sbin/nvmecontrol/nvmecontrol.8
/freebsd-10-stable/sbin/rcorder/rcorder.8
/freebsd-10-stable/sbin/reboot/nextboot.8
/freebsd-10-stable/sbin/recoverdisk/recoverdisk.1
/freebsd-10-stable/sbin/sconfig/sconfig.8
/freebsd-10-stable/share/examples/mdoc/example.1
/freebsd-10-stable/share/examples/mdoc/example.3
/freebsd-10-stable/share/examples/mdoc/example.4
/freebsd-10-stable/share/examples/mdoc/example.9
/freebsd-10-stable/share/examples/scsi_target/scsi_target.8
/freebsd-10-stable/tools/tools/ether_reflect/ether_reflect.1
/freebsd-10-stable/tools/tools/fixwhite/fixwhite.1
/freebsd-10-stable/tools/tools/mcgrab/mcgrab.1
/freebsd-10-stable/tools/tools/mctest/mctest.1
/freebsd-10-stable/tools/tools/sysdoc/sysdoc.sh
/freebsd-10-stable/tools/tools/vimage/vimage.8
301917 15-Jun-2016 truckman

MFC r299484, r301574

r299484 | cem | 2016-05-11 15:04:28 -0700 (Wed, 11 May 2016) | 13 lines

random(6): Fix double-close

In the case where a file lacks a trailing newline, there is some "evil" code to
reverse goto the tokenizing code ("make_token") for the final token in the
file. In this case, 'fd' is closed more than once. Use a negative sentinel
value to guard close(2), preventing the double close.

Ideally, this code would be restructured to avoid this ugly construction.

r301574 | truckman | 2016-06-07 19:14:05 -0700 (Tue, 07 Jun 2016) | 15 lines

Fix a (false positive?) Argument cannot be negative coverity defect.

Rather than guarding close(fd) with an fd >= 0 test and setting fd
to -1 when it is closed to avoid a potential double-close, just
move the close() call after the conditional "goto make_token". This
moves the close() call totally outside the loop to avoid the
possibility of calling it twice. This should also prevent a Coverity
warning about checking fd for validity after it was previously passed
to read().

Reported by: Coverity
CID: 1006123, 1355335

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


241847 22-Oct-2012 eadler

Free buf when its no longer used. This helps eliminate a static analysis
warning.

PR: ports/172566
Submitted by: Erik Cederstrand <erik@cederstrand.dk>
Approved by: cperciva
MFC after: 3 days


216239 06-Dec-2010 uqs

Drop advertising clause in manpages. It was done a long time ago
for the source code.

Discussed with: core


209157 14-Jun-2010 uqs

random(6): avoid dead assignments

Found by: clang static analyzer


203932 15-Feb-2010 imp

Remove the third clause for the Berkeley parts of games, per the
letter in /COPYRIGHT.


203923 15-Feb-2010 uqs

games: make WARNS=6 the default, remove overrides

This also bumps factor, fortune, primes, and random to WARNS=6.

Approved by: ed (Co-mentor)


181615 11-Aug-2008 ache

Suggections from bde@
1) Split too long source lines
2) Portable code should not assume that null pointer == all-bits-0,
so back out prev. calloc() change.

Submitted by: bde


181527 10-Aug-2008 ache

All cosmetic.
1) Rename RANDOM_MAX to RANDOM_MAX_PLUS1 to not confuse with random()'s max
2) Use calloc() instead of zeroing fields explicitly
3) "too many lines" -> "too many delimiters" for err()


181412 08-Aug-2008 ache

1) Fix longstanding math bug with denominator > 1 (wrong probability).
Test case:
random -f some_small_file 10000
(in most cases must be no output)
2) Prevent number of lines > RANDOM_MAX (overflow or nothing may be
choosed) with EFBIG err()
3) After line is found, terminate list loop for -U case too,
since nothing to do in the rest of the loop left.


181410 08-Aug-2008 ache

I was confused a bit by the wrong construction with RAND_MAX
used in randomize_fd.c.
Although the max value is the same currently, RAND_MAX is for rand(),
not for random().
So move RANDOM_MAX const to the common file now, make it UL and
use in randomize_fd.c too.
(in any case its old value was 1 less then must be, as noted in
the prev. commit)


181409 08-Aug-2008 ache

1) Replace hardcoded RANDOM_MAX macro with wrong (1 less than must be)
value with ((double)RAND_MAX + 1)
2) For exit code increase valid denominator upper range from 255 to 256
since returned value is [0 .. denom - 1]


157758 14-Apr-2006 ache

1) Fix hang at the end of line buffer (PR 95715)
2) Localize

PR: 95715
Submitted by: Li-Lun Wang <llwang@infor.org> (slightly edited by me)


147530 22-Jun-2005 jhb

Correct an error in the previous revision. RAND_MAX is the maximum value
for rand(3), not random(3). random(3) is defined to return values between
0 and 2^31-1, so add a local RANDOM_MAX constant to this file that is
defined as 2^31-1 and use that in place of RAND_MAX.

Reviewed by: bde
Approved by: re (dwhite)
MFC after: 1 week


146686 27-May-2005 jhb

Fix for 64-bit platforms. random() returns values between 0 and RAND_MAX,
and RAND_MAX != LONG_MAX on 64-bit platforms.

PR: amd64/81279
Submitted by: Vivek Khera vivek at khera dot org
Submitted by: Adriaan de Groot groot at kde dot org
MFC after: 1 week


141581 09-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


140408 18-Jan-2005 ru

Sort sections.


136090 03-Oct-2004 stefanf

Properly initialise 'filename' so that random -l doesn't try to open NULL.

Const-qualify 'filename' to avoid a strdup() call due to -Wwrite-strings
silliness.


114725 05-May-2003 obrien

Make the __FBSDID usage consistent
and protect copyright[] from Gcc 3.3's whining.


111279 23-Feb-2003 ru

Fixed SYNOPSIS.
Expanded stdin/stdout definitions.
Ordered the SEE ALSO references.
Moved some chat from the BUGS section to freebsd-chat@.
Removed ``cvs log'' material from the HISTORY section.


110928 15-Feb-2003 seanc

flexlint rears its head as well as some style(9) fixes[1]. Fixed a
few bugs for a few corner cases and correctly handle the case where
read(2) is read()'ing from a non-file descriptor and could get fewer
bytes back than the buffer, but it isn't EOF[2]. random(6) extensively
tested and believed to be bug free (save performance for large files).

Submitted by: mkm [1], tjr[2]


110723 11-Feb-2003 seanc

Update random(6) to have the ability to randomize a file/stdin based
off of lines or words. See the man page for details.

Reviewed by: markm
MFC after: 3 days


90828 18-Feb-2002 imp

Remove __P
Remove __STDC__ (which means we now use stdarg rather than vararg)
Remove register
Remove main prototype


79528 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


74814 26-Mar-2001 ru

- Backout botched attempt to intoduce MANSECT feature.
- MAN[1-9] -> MAN.


74528 20-Mar-2001 ru

Set the default manual section for games/ to 6.


68937 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


54482 12-Dec-1999 billf

-Wall fixes.


53920 30-Nov-1999 billf

copyright/sccsid/rcsid cleanup.


50472 27-Aug-1999 peter

$Id$ -> $FreeBSD$


48793 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


33937 01-Mar-1998 jkh

Wargh! Who went and changed all the getopt() comparisons from -1 to
EOF? The getopt(3) manpage clearly states that the return value is *-1*,
not EOF! Besides, getopt(3) isn't reading from a file. :)

Noticed-while: merging to 2.2 (where this is correct).


29016 01-Sep-1997 ache

Remove so-called revoke, this game never installed sguid


28979 01-Sep-1997 eivind

Change games from setuid games to setgid games.

Reviewed by: maybe@yes.no
Obtained from: OpenBSD (mostly deraadt@openbsd.org)


26627 14-Jun-1997 ache

Remove srandomdev fallback code


24420 30-Mar-1997 ache

Use srandomdev() now
Add range checking for invalid denominator values


23699 11-Mar-1997 ache

Fix srandom arg type accodring to Lite2
Use ^ getpid() instead of + getpid()


8856 30-May-1995 rgrimes

Remove trailing whitespace.


6160 03-Feb-1995 bde

Include <limits.h> to get LONG_MAX - don't depend on namespace pollution
in <time.h>.


2491 04-Sep-1994 jkh

This commit was generated by cvs2svn to compensate for changes in r2490,
which included commits to RCS files with non-trunk default branches.