|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: control.c,v 1.15 2019/05/28 06:49:46 otto Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: control.c,v 1.16 2019/07/07 19:17:40 otto Exp $ */ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
|
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> |
|
@ -47,12 +47,12 @@ control_check(char *path) |
|
|
strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); |
|
|
strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); |
|
|
|
|
|
|
|
|
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { |
|
|
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { |
|
|
log_warn("control_check: socket check"); |
|
|
|
|
|
|
|
|
log_debug("control_check: socket check"); |
|
|
return (-1); |
|
|
return (-1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) { |
|
|
if (connect(fd, (struct sockaddr *)&sun, sizeof(sun)) == 0) { |
|
|
log_warnx("control_check: socket in use"); |
|
|
|
|
|
|
|
|
log_debug("control_check: socket in use"); |
|
|
close(fd); |
|
|
close(fd); |
|
|
return (-1); |
|
|
return (-1); |
|
|
} |
|
|
} |
|
|