- {
- char *dot;
- system_name_length = 32;
-
- while (1)
- {
- system_name = (char *) xmalloc (system_name_length + 1);
-
- /* system_name must be null-terminated string. */
- system_name[system_name_length] = '\0';
-
- if (gethostname (system_name, system_name_length) == 0)
- break;
-
- free (system_name);
- system_name_length *= 2;
- }
-
- /* We always use the non-dotted host name, for simplicity. */
- dot = index (system_name, '.');
- if (dot)
- *dot = '\0';
- }
-