summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-08 04:21:02 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-08 04:21:02 +0100
commit391c9d80dba7e30b164bc6217a0ee18f6039eea9 (patch)
tree6b2b1f7aca6a9b9ae13f4e07e68e0899407bf61a /hurd
parent572e194e455b8b7d394bcbcea2f156f02714bffe (diff)
Rework patch
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurdsocket.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/hurd/hurdsocket.h b/hurd/hurdsocket.h
index fd45f34238..611c18eb76 100644
--- a/hurd/hurdsocket.h
+++ b/hurd/hurdsocket.h
@@ -16,7 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _HURD_HURDSOCKET_H
+#define _HURD_HURDSOCKET_H
+
#include <string.h>
-#define _hurd_sun_path_dupa(__addr, __len) \
- strndupa ((__addr)->sun_path, (__len) - offsetof (struct sockaddr_un, sun_path))
+/* Returns a duplicate of ADDR->sun_path with LEN limitation. This
+ should to be used whenever reading a unix socket address, to cope with
+ sun_path possibly not including a trailing \0. */
+#define _hurd_sun_path_dupa(addr, len) \
+ strndupa ((addr)->sun_path, (len) - offsetof (struct sockaddr_un, sun_path))
+
+#endif /* hurdsocket.h */