diff options
Diffstat (limited to 'test/zdtm/static/sk-unix-unconn.c')
-rw-r--r-- | test/zdtm/static/sk-unix-unconn.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/zdtm/static/sk-unix-unconn.c b/test/zdtm/static/sk-unix-unconn.c index 8e600130d..abf59e39b 100644 --- a/test/zdtm/static/sk-unix-unconn.c +++ b/test/zdtm/static/sk-unix-unconn.c @@ -12,7 +12,7 @@ const char *test_author = "Vagin Andrew <avagin@parallels.com>"; int main(int argc, char ** argv) { int sk, skc; - int ret; + int ret, len; char path[PATH_MAX]; struct sockaddr_un addr; socklen_t addrlen; @@ -31,12 +31,13 @@ int main(int argc, char ** argv) return 1; } - snprintf(path, sizeof(path), "X/zdtm-%s-%d", argv[0], getpid()); + len = snprintf(path, sizeof(path), "X/zdtm-%s-%d/X", argv[0], getpid()); addr.sun_family = AF_UNIX; strncpy(addr.sun_path, path, sizeof(addr.sun_path)); - addrlen = sizeof(addr.sun_family) + strlen(path); + addrlen = sizeof(addr.sun_family) + len; addr.sun_path[0] = 0; + addr.sun_path[len - 1] = 0; ret = bind(sk, (struct sockaddr *) &addr, addrlen); if (ret) { |