mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
sockets00: use snprintf()
Way easier this way. Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
committed by
Cyrill Gorcunov
parent
f5ca8b98fe
commit
a3fe624c55
@@ -56,9 +56,7 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(path, 0, sizeof(path));
|
||||
strncat(path, cwd, sizeof(path));
|
||||
strncat(path, "/test-socket", sizeof(path));
|
||||
snprintf(path, sizeof(path), "%s/test-socket", cwd);
|
||||
unlink(path);
|
||||
|
||||
addr.sun_family = AF_UNIX;
|
||||
@@ -110,25 +108,19 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
memset(path, 0, sizeof(path));
|
||||
strncat(path, cwd, sizeof(path));
|
||||
strncat(path, "/test-socket-bound", sizeof(path));
|
||||
snprintf(path, sizeof(path), "%s/test-socket-bound", cwd);
|
||||
unlink(path);
|
||||
|
||||
name_bound.sun_family = AF_UNIX;
|
||||
strncpy(name_bound.sun_path, path, sizeof(name_bound.sun_path));
|
||||
|
||||
memset(path, 0, sizeof(path));
|
||||
strncat(path, cwd, sizeof(path));
|
||||
strncat(path, "/test-socket-conn", sizeof(path));
|
||||
snprintf(path, sizeof(path), "%s/test-socket-conn", cwd);
|
||||
unlink(path);
|
||||
|
||||
name_conn.sun_family = AF_UNIX;
|
||||
strncpy(name_conn.sun_path, path, sizeof(name_conn.sun_path));
|
||||
|
||||
memset(path, 0, sizeof(path));
|
||||
strncat(path, cwd, sizeof(path));
|
||||
strncat(path, "/test-socket-bound-conn", sizeof(path));
|
||||
snprintf(path, sizeof(path), "%s/test-socket-bound-conn", cwd);
|
||||
unlink(path);
|
||||
|
||||
name_bound_conn.sun_family = AF_UNIX;
|
||||
|
Reference in New Issue
Block a user