From owner-svn-src-all@freebsd.org Sat May 23 03:32:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 813752F6481; Sat, 23 May 2020 03:32:09 +0000 (UTC) (envelope-from markj@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TTS92w2sz4H5T; Sat, 23 May 2020 03:32:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 455159A03; Sat, 23 May 2020 03:32:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04N3W92s010848; Sat, 23 May 2020 03:32:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04N3W9x0010847; Sat, 23 May 2020 03:32:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005230332.04N3W9x0010847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 23 May 2020 03:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361408 - stable/12/lib/libc/tests/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/tests/sys X-SVN-Commit-Revision: 361408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 03:32:09 -0000 Author: markj Date: Sat May 23 03:32:08 2020 New Revision: 361408 URL: https://svnweb.freebsd.org/changeset/base/361408 Log: Revert mlock_helper.c test code changes from r361350. They were not intended to be merged, since the MFC did not change the max_wired sysctl name. This is a direct commit to stable/12. Reported by: lwhsu Modified: stable/12/lib/libc/tests/sys/mlock_helper.c Modified: stable/12/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- stable/12/lib/libc/tests/sys/mlock_helper.c Fri May 22 22:17:44 2020 (r361407) +++ stable/12/lib/libc/tests/sys/mlock_helper.c Sat May 23 03:32:08 2020 (r361408) @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define VM_MAX_WIRED "vm.max_user_wired" +#define VM_MAX_WIRED "vm.max_wired" static void -vm_max_wired_sysctl(u_long *old_value, u_long *new_value) +vm_max_wired_sysctl(int *old_value, int *new_value) { size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); if (old_value == NULL) - printf("Setting the new value to %lu\n", *new_value); + printf("Setting the new value to %d\n", *new_value); else { ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, new_value, new_len) == 0, @@ -60,14 +60,14 @@ vm_max_wired_sysctl(u_long *old_value, u_long *new_val "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); if (old_value != NULL) - printf("Saved the old value (%lu)\n", *old_value); + printf("Saved the old value (%d)\n", *old_value); } void -set_vm_max_wired(u_long new_value) +set_vm_max_wired(int new_value) { FILE *fp; - u_long old_value; + int old_value; fp = fopen(VM_MAX_WIRED, "w"); if (fp == NULL) { @@ -78,7 +78,7 @@ set_vm_max_wired(u_long new_value) vm_max_wired_sysctl(&old_value, NULL); - ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, "saving %s failed", VM_MAX_WIRED); fclose(fp); @@ -90,7 +90,7 @@ void restore_vm_max_wired(void) { FILE *fp; - u_long saved_max_wired; + int saved_max_wired; fp = fopen(VM_MAX_WIRED, "r"); if (fp == NULL) { @@ -98,14 +98,14 @@ restore_vm_max_wired(void) return; } - if (fscanf(fp, "%lu", &saved_max_wired) != 1) { + if (fscanf(fp, "%d", &saved_max_wired) != 1) { perror("fscanf failed\n"); fclose(fp); return; } fclose(fp); - printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); if (saved_max_wired == 0) /* This will cripple the test host */ return;