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);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(path, 0, sizeof(path));
|
snprintf(path, sizeof(path), "%s/test-socket", cwd);
|
||||||
strncat(path, cwd, sizeof(path));
|
|
||||||
strncat(path, "/test-socket", sizeof(path));
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
@@ -110,25 +108,19 @@ int main(int argc, char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(path, 0, sizeof(path));
|
snprintf(path, sizeof(path), "%s/test-socket-bound", cwd);
|
||||||
strncat(path, cwd, sizeof(path));
|
|
||||||
strncat(path, "/test-socket-bound", sizeof(path));
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
name_bound.sun_family = AF_UNIX;
|
name_bound.sun_family = AF_UNIX;
|
||||||
strncpy(name_bound.sun_path, path, sizeof(name_bound.sun_path));
|
strncpy(name_bound.sun_path, path, sizeof(name_bound.sun_path));
|
||||||
|
|
||||||
memset(path, 0, sizeof(path));
|
snprintf(path, sizeof(path), "%s/test-socket-conn", cwd);
|
||||||
strncat(path, cwd, sizeof(path));
|
|
||||||
strncat(path, "/test-socket-conn", sizeof(path));
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
name_conn.sun_family = AF_UNIX;
|
name_conn.sun_family = AF_UNIX;
|
||||||
strncpy(name_conn.sun_path, path, sizeof(name_conn.sun_path));
|
strncpy(name_conn.sun_path, path, sizeof(name_conn.sun_path));
|
||||||
|
|
||||||
memset(path, 0, sizeof(path));
|
snprintf(path, sizeof(path), "%s/test-socket-bound-conn", cwd);
|
||||||
strncat(path, cwd, sizeof(path));
|
|
||||||
strncat(path, "/test-socket-bound-conn", sizeof(path));
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
|
|
||||||
name_bound_conn.sun_family = AF_UNIX;
|
name_bound_conn.sun_family = AF_UNIX;
|
||||||
|
Reference in New Issue
Block a user