summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2021-12-01 10:24:41 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2021-12-01 10:24:41 +0000
commitef263dec754c1a3c1a88f1157ce1b4e6198ad8fd (patch)
tree3f41eeada4e33fd804d5b5b8ebd0b3e8e01cc708 /regress
parentccde8efe5fb30c7b44bda8fc6082cb02732ee543 (diff)
Make `sun' global variable. It used by threads and could be corrupted
when main() thread exited.
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/kern/unconacc/unconacc.c5
-rw-r--r--regress/sys/kern/undgram_conclose/undgram_conclose.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/regress/sys/kern/unconacc/unconacc.c b/regress/sys/kern/unconacc/unconacc.c
index c687091260f..52ca734e192 100644
--- a/regress/sys/kern/unconacc/unconacc.c
+++ b/regress/sys/kern/unconacc/unconacc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unconacc.c,v 1.3 2021/11/29 21:25:09 mvs Exp $ */
+/* $OpenBSD: unconacc.c,v 1.4 2021/12/01 10:24:40 mvs Exp $ */
/*
* Copyright (c) 2021 Vitaliy Makkoveev <mvs@openbsd.org>
@@ -119,6 +119,8 @@ thr_conn(void *arg)
return NULL;
}
+static struct sockaddr_un sun;
+
int
main(int argc, char *argv[])
{
@@ -127,7 +129,6 @@ main(int argc, char *argv[])
.tv_nsec = 0,
};
- struct sockaddr_un sun;
int s;
int mib[2], ncpu;
diff --git a/regress/sys/kern/undgram_conclose/undgram_conclose.c b/regress/sys/kern/undgram_conclose/undgram_conclose.c
index 678021d5714..8f5415905f1 100644
--- a/regress/sys/kern/undgram_conclose/undgram_conclose.c
+++ b/regress/sys/kern/undgram_conclose/undgram_conclose.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undgram_conclose.c,v 1.3 2021/11/29 21:25:09 mvs Exp $ */
+/* $OpenBSD: undgram_conclose.c,v 1.4 2021/12/01 10:24:40 mvs Exp $ */
/*
* Copyright (c) 2021 Vitaliy Makkoveev <mvs@openbsd.org>
@@ -97,6 +97,8 @@ thr_conn(void *arg)
return NULL;
}
+static struct sockaddr_un sun;
+
int
main(int argc, char *argv[])
{
@@ -108,8 +110,6 @@ main(int argc, char *argv[])
int mib[2], ncpu;
size_t len;
- struct sockaddr_un sun;
-
pthread_t thr;
int error, i;