mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
zdtm: Pick up deleted unix socket test (v2)
CRIU doesn't support relative unix sockets paths, so tune the test to use absolute. (v2: Off-by-one spotted by Filipe) Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -59,6 +59,7 @@ static/sock_opts01
|
|||||||
static/sockets_spair
|
static/sockets_spair
|
||||||
static/sockets_dgram
|
static/sockets_dgram
|
||||||
static/socket_queues
|
static/socket_queues
|
||||||
|
static/deleted_unix_sock
|
||||||
static/sk-unix-unconn
|
static/sk-unix-unconn
|
||||||
static/pid00
|
static/pid00
|
||||||
static/pstree
|
static/pstree
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
#define _GNU_SOURCE
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -19,11 +20,14 @@ TEST_OPTION(filename, string, "file name", 1);
|
|||||||
|
|
||||||
static int fill_sock_name(struct sockaddr_un *name, const char *filename)
|
static int fill_sock_name(struct sockaddr_un *name, const char *filename)
|
||||||
{
|
{
|
||||||
if (strlen(filename) >= sizeof(name->sun_path))
|
char *cwd;
|
||||||
|
|
||||||
|
cwd = get_current_dir_name();
|
||||||
|
if (strlen(filename) + strlen(cwd) + 1 >= sizeof(name->sun_path))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
name->sun_family = AF_LOCAL;
|
name->sun_family = AF_LOCAL;
|
||||||
strcpy(name->sun_path, filename);
|
sprintf(name->sun_path, "%s/%s", cwd, filename);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user