[patch] HOST_NAME_MAX not defined

Sjoerd Simons sjoerd at luon.net
Wed Jun 23 12:30:21 PDT 2004


Hi,

  It seems HOST_NAME_MAX is not defined on my system (debian unstable). 
  According to the gethostname manpage:
    SUSv2 guarantees that `Host names are limited  to  255  bytes'.  POSIX
    1003.1-2001  guarantees that `Host names (not including the terminating
    NUL) are limited to HOST_NAME_MAX bytes'.

  So setting HOST_NAME_MAX to 256 in case it's undefined is ok I guess. Patch 
  attached to do this.

  Sjoerd
-- 
Nature is by and large to be found out of doors, a location where,
it cannot be argued, there are never enough comfortable chairs.
		-- Fran Lebowitz
-------------- next part --------------
Index: hald/pstore.c
===================================================================
RCS file: /cvs/hal/hal/hald/pstore.c,v
retrieving revision 1.1
diff -u -r1.1 pstore.c
--- hald/pstore.c	20 Jun 2004 14:05:12 -0000	1.1
+++ hald/pstore.c	23 Jun 2004 19:25:38 -0000
@@ -43,6 +43,10 @@
 #define PDOUBLE		"Double:"
 #define UDI_STRIP	"/org/freedesktop/Hal"
 
+#ifndef HOST_NAME_MAX
+  #define HOST_NAME_MAX 256
+#endif
+
 static char *pstore_uuid = NULL;
 
 struct _HalPStore {
-------------- next part --------------
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list