Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/sharefd_p.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 52 | private: | |||
---|---|---|---|---|---|
54 | { | 54 | { | ||
55 | sockaddr_un a; | 55 | sockaddr_un a; | ||
56 | memset(&a, 0, sizeof a); | 56 | memset(&a, 0, sizeof a); | ||
57 | a.sun_family = AF_UNIX; | 57 | a.sun_family = AF_UNIX; | ||
58 | std::string finalPath = "/tmp/" + path; | 58 | std::string finalPath = "/tmp/" + path; | ||
59 | const size_t pathSize = finalPath.size(); | 59 | const size_t pathSize = finalPath.size(); | ||
60 | if (pathSize > 5 && pathSize < sizeof(a.sun_path) - 1) { | 60 | if (pathSize > 5 && pathSize < sizeof(a.sun_path) - 1) { | ||
61 | memcpy(a.sun_path, finalPath.c_str(), pathSize + 1); | 61 | memcpy(a.sun_path, finalPath.c_str(), pathSize + 1); | ||
62 | ::unlink(finalPath.c_str()); | | |||
63 | } | 62 | } | ||
64 | return a; | 63 | return a; | ||
65 | } | 64 | } | ||
66 | }; | 65 | }; | ||
67 | 66 | | |||
68 | class FDMessageHeader | 67 | class FDMessageHeader | ||
69 | { | 68 | { | ||
70 | char io_buf[2]; | 69 | char io_buf[2]; | ||
Show All 30 Lines |