From nobody Tue Jun 11 13:53:40 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vz9BD5ZVqz5Ly8s; Tue, 11 Jun 2024 13:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vz9BD51Bcz4jhg; Tue, 11 Jun 2024 13:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718114020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gqx9rxUu0kixtEs2AkdN9O9prToKqpYENgy09XKllo0=; b=PNAj/MOgSgOqB3FUW35FkUCiLQUUVd9h36m/qnPkbuhF0XC1QtOrRAzt1OZvuw05hB9GZt FZZxg/fFawRAVugVW+O8Tx8+zBP4COg6SVRSI9qainnrc/kaZR2jEmmYljG2VmygZ2iJ5k Lxkpj4VDNEiineIsBsDoDQmPorne+qUY8RQ312AjlDnioNcNA+ldthyasmRCBLvh14QxCQ YU8DCccqYsFY87ium1xhCig7ULrECmSSfzOSJdHoZ4gC898k2HkXnDlxS2Utl2s4ewmlBd 9RxRMywdaO2NyhqQQo6ELTPZLNJwKoUyI6xIawtjbrRbasDgpgdpHIgZb5AV9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718114020; a=rsa-sha256; cv=none; b=px8rjskrI61fOLPVYMPmVvHpmPJqvOPPW1qLW5POiwmOQB4OE+8FLTI3rmhnSTUe/OIF8r LW3oBfWBc8vOChsq8WnDAo3v4oCOo9N3nxbB4SA9xE0QGIKiHJRKmPTG3xpEkMn0fmzb/y fSmFhBJIIpNlde/42PGqQahjNCeg+P5SkbFexbS3QRZM5O8pcSiVBDWwhOgHVm0P80rUti tfNLL2NAm6BQ1+gMdyBqqS3MUD+hbPos8Qamwh3zNUsIFwxJmR70myf7toGN9pdFGyHpd/ RPJ8yRRyqEYrSr4iVGYo6HV8U42ALUKwS14VdF4IZVknmQx236enWs/nUVQDbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718114020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gqx9rxUu0kixtEs2AkdN9O9prToKqpYENgy09XKllo0=; b=ePgg3dr3pou7cwqk6wC1z9NYQHpcE4cRwh1nFUVFwKMW2OCUxaluXdPKMz9lQr6dS9s+H0 8og5qOlLuEeaa5G25Ra5wsqyC7i9njr0YLeTNRtlAC12zy7Sm9nPaIN/YAh7XDxe1E8GrE etmX2j9cF1GLieHTGI7BIZfqvRKVT8vTNQnYaf5EwMUiCqmG3KnxyDXEvFx9vgclvcxZSq +sPETcETccMQPshe5LmveAnCZ4wqjVJ+PfnPTNrutBqMv/656FgW6BgqlENezp0oRINW+/ vhpWgKWMFv9v1gl90JhZbzDh6i/q+YAyuGkf8Af3UXONHKwbpPLjWR4XNQf8wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vz9BD4SpYz1BKR; Tue, 11 Jun 2024 13:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45BDreIe022473; Tue, 11 Jun 2024 13:53:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45BDremQ022470; Tue, 11 Jun 2024 13:53:40 GMT (envelope-from git) Date: Tue, 11 Jun 2024 13:53:40 GMT Message-Id: <202406111353.45BDremQ022470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: ff4a72c159e0 - main - stress2: Replace random() with arc4random() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff4a72c159e06c15a4573b9a4b40f6dc55544538 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4a72c159e06c15a4573b9a4b40f6dc55544538 commit ff4a72c159e06c15a4573b9a4b40f6dc55544538 Author: Peter Holm AuthorDate: 2024-06-11 13:52:34 +0000 Commit: Peter Holm CommitDate: 2024-06-11 13:52:34 +0000 stress2: Replace random() with arc4random() --- tools/test/stress2/misc/nfsrename.sh | 4 ++-- tools/test/stress2/misc/umountf2.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/test/stress2/misc/nfsrename.sh b/tools/test/stress2/misc/nfsrename.sh index b6513fba1553..864c64aed8ac 100755 --- a/tools/test/stress2/misc/nfsrename.sh +++ b/tools/test/stress2/misc/nfsrename.sh @@ -137,7 +137,7 @@ write_file(void) unlink(path); } - fprintf(fp, "blah blah blah garbage %ld\n", random()); + fprintf(fp, "blah blah blah garbage %ld\n", (long)arc4random()); fclose(fp); if (rename(path, filename) < 0) { warn("rename"); @@ -150,7 +150,7 @@ random_sleep(int base, int slop) { long val; - val = random() % slop; + val = arc4random() % slop; usleep(base + val); } diff --git a/tools/test/stress2/misc/umountf2.sh b/tools/test/stress2/misc/umountf2.sh index 5018a804c403..cd5b53616f97 100755 --- a/tools/test/stress2/misc/umountf2.sh +++ b/tools/test/stress2/misc/umountf2.sh @@ -886,11 +886,12 @@ test(void) { unsigned long offset; unsigned long size = maxoplen; - unsigned long rv = random(); + unsigned long rv; unsigned long op = rv % (3 + !lite + mapped_writes); /* turn off the map read if necessary */ + arc4random_buf(&rv, sizeof(rv)); if (op == 2 && !mapped_reads) op = 0;