with "make clean".
-# $OpenBSD: Makefile,v 1.1 2021/11/29 13:05:04 mvs Exp $
+# $OpenBSD: Makefile,v 1.2 2021/11/29 21:21:26 mvs Exp $
# Copyright (c) 2021 Makkoveev Vitaliy <mvs@openbsd.org>
#
PROG = unconacc
LDADD+= -lpthread
+CLEANFILES += unconacc.socket
+
.include <bsd.regress.mk>
-/* $OpenBSD: unconacc.c,v 1.1 2021/11/29 13:05:04 mvs Exp $ */
+/* $OpenBSD: unconacc.c,v 1.2 2021/11/29 21:21:26 mvs Exp $ */
/*
* Copyright (c) 2021 Vitaliy Makkoveev <mvs@openbsd.org>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/un.h>
#include <stdarg.h>
int i;
+ umask(0077);
+
if (argc == 2 && !strcmp(argv[1], "--infinite"))
tv = NULL;
memset(&sun, 0, sizeof(sun));
sun.sun_len = sizeof(sun);
sun.sun_family = AF_UNIX;
- snprintf(sun.sun_path, sizeof(sun.sun_path) - 1,
- "/tmp/socket%d", getpid());
+ snprintf(sun.sun_path, sizeof(sun.sun_path) - 1, "unconacc.socket");
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
err(1, "socket");
-# $OpenBSD: Makefile,v 1.1 2021/11/19 17:14:38 mvs Exp $
+# $OpenBSD: Makefile,v 1.2 2021/11/29 21:21:26 mvs Exp $
# Copyright (c) 2021 Makkoveev Vitaliy <mvs@openbsd.org>
#
PROG = undgram_conclose
LDADD+= -lpthread
+CLEANFILES += undgram_conclose.socket
+
.include <bsd.regress.mk>
-/* $OpenBSD: undgram_conclose.c,v 1.1 2021/11/19 17:14:38 mvs Exp $ */
+/* $OpenBSD: undgram_conclose.c,v 1.2 2021/11/29 21:21:26 mvs Exp $ */
/*
* Copyright (c) 2021 Vitaliy Makkoveev <mvs@openbsd.org>
#include <sys/types.h>
#include <sys/select.h>
#include <sys/socket.h>
+#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/un.h>
#include <stdarg.h>
pthread_t thr;
int error, i;
+ umask(0077);
+
if (argc == 2 && !strcmp(argv[1], "--infinite"))
tv = NULL;
sun.sun_len = sizeof(sun);
sun.sun_family = AF_UNIX;
snprintf(sun.sun_path, sizeof(sun.sun_path) - 1,
- "/tmp/socket%d", getpid());
+ "undgram_conclose.socket");
if ((error = pthread_create(&thr, NULL, thr_close, &sun)))
therrc(1, error, "pthread_create");