Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/dev/cgd Don't use mktemp.



details:   https://anonhg.NetBSD.org/src/rev/b3aab95e802b
branches:  trunk
changeset: 348786:b3aab95e802b
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Mon Nov 07 18:11:45 2016 +0000

description:
Don't use mktemp.

diffstat:

 tests/dev/cgd/t_cgd_aes.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r 371395f8179c -r b3aab95e802b tests/dev/cgd/t_cgd_aes.c
--- a/tests/dev/cgd/t_cgd_aes.c Mon Nov 07 16:33:37 2016 +0000
+++ b/tests/dev/cgd/t_cgd_aes.c Mon Nov 07 18:11:45 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_cgd_aes.c,v 1.1 2016/11/06 10:54:42 alnsn Exp $      */
+/*     $NetBSD: t_cgd_aes.c,v 1.2 2016/11/07 18:11:45 alnsn Exp $      */
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
  * Copyright (c) 2007 The Institute of Electrical and Electronics Engineers, Inc
@@ -1232,7 +1232,7 @@
 {
        int fd;
 
-       fd = open(imgpath, O_CREAT | O_RDWR | O_EXCL, 0600);
+       fd = open(imgpath, O_CREAT | O_RDWR | O_TRUNC, 0600);
        if (fd < 0)
                return -1;
 
@@ -1352,7 +1352,7 @@
 
 ATF_TC_BODY(cgd_aes_xts_256, tc)
 {
-       char imgpath[] = "aes-xts-256.XXXXXX";
+       const char imgpath[] = "aes-xts-256.img";
        const char *dkpath = "/dev/dk";
        const size_t dksize = 256 * SECSIZE; /* Last blkno is 0xff. */
        int dkfd, cgdfd;
@@ -1361,7 +1361,6 @@
 
        rump_init();
 
-       mktemp(imgpath);
        RL(dkfd = open_disk(dkpath, imgpath, dksize));
 
        RL(cgdfd = open_cgd(0));
@@ -1407,7 +1406,7 @@
 
 ATF_TC_BODY(cgd_aes_xts_512, tc)
 {
-       char imgpath[] = "aes-xts-512.XXXXXX";
+       const char imgpath[] = "aes-xts-512.img";
        const char *dkpath = "/dev/dk";
        const size_t dksize = 65536 * SECSIZE; /* Last blkno is 0xffff. */
        int dkfd, cgdfd;
@@ -1416,7 +1415,6 @@
 
        rump_init();
 
-       mktemp(imgpath);
        RL(dkfd = open_disk(dkpath, imgpath, dksize));
 
        RL(cgdfd = open_cgd(0));



Home | Main Index | Thread Index | Old Index