From 391c9d80dba7e30b164bc6217a0ee18f6039eea9 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 8 Feb 2015 04:21:02 +0100 Subject: Rework patch --- hurd/hurdsocket.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'hurd') 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 . */ +#ifndef _HURD_HURDSOCKET_H +#define _HURD_HURDSOCKET_H + #include -#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 */ -- cgit v1.2.3