diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-05-05 22:24:36 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:12:58 +0200 |
commit | 34a47924489b195799b36932f56db80f2d4e1ab6 (patch) | |
tree | 067936d960bb2b0f88f24c18fa4615fd14defc43 /src/shared | |
parent | a799bc503d6055ecc97fce94d0685fdfe055a3f4 (diff) |
tree-wide: introduce new SOCKADDR_UN_LEN() macro, and use it everywhere
The macro determines the right length of a AF_UNIX "struct sockaddr_un" to pass to
connect() or bind(). It automatically figures out if the socket refers to an
abstract namespace socket, or a socket in the file system, and properly handles
the full length of the path field.
This macro is not only safer, but also simpler to use, than the usual
offsetof() + strlen() logic.
Diffstat (limited to 'src/shared')
0 files changed, 0 insertions, 0 deletions