mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-09 09:51:49 +08:00
Merge branch 'tmp-remove' into 'master'
Check return value of remove() See merge request openconnect/ocserv!427
This commit is contained in:
+6
-1
@@ -131,7 +131,12 @@ int ctl_handler_init(main_server_st * s)
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sun_family = AF_UNIX;
|
||||
strlcpy(sa.sun_path, GETPCONFIG(s)->occtl_socket_file, sizeof(sa.sun_path));
|
||||
remove(GETPCONFIG(s)->occtl_socket_file);
|
||||
ret = remove(GETPCONFIG(s)->occtl_socket_file);
|
||||
if (ret != 0) {
|
||||
e = errno;
|
||||
mslog(s, NULL, LOG_DEBUG, "could not delete socket: '%s': %s",
|
||||
GETPCONFIG(s)->occtl_socket_file, strerror(e));
|
||||
}
|
||||
|
||||
sd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sd == -1) {
|
||||
|
||||
Reference in New Issue
Block a user