2011/11/23 Axel Beckert <a...@debian.org>: > Seems as if it works:
Thanks for testing. Patch updated. -- Robert Millan
diff --git a/netcfg-common.c b/netcfg-common.c index 4b2a8a0..6053a48 100644 --- a/netcfg-common.c +++ b/netcfg-common.c @@ -1042,19 +1042,23 @@ void netcfg_write_common(struct in_addr ipaddress, char *hostname, char *domain) if ((fp = file_open(HOSTS_FILE, "w"))) { char ptr1[INET_ADDRSTRLEN]; - fprintf(fp, "127.0.0.1\tlocalhost\n"); + fprintf(fp, "127.0.0.1\tlocalhost"); if (ipaddress.s_addr) { inet_ntop (AF_INET, &ipaddress, ptr1, sizeof(ptr1)); if (domain_nodot && !empty_str(domain_nodot)) - fprintf(fp, "%s\t%s.%s\t%s\n", ptr1, hostname, domain_nodot, hostname); + fprintf(fp, "\n%s\t%s.%s\t%s\n", ptr1, hostname, domain_nodot, hostname); else - fprintf(fp, "%s\t%s\n", ptr1, hostname); + fprintf(fp, "\n%s\t%s\n", ptr1, hostname); } else { +#ifndef __FreeBSD_kernel__ if (domain_nodot && !empty_str(domain_nodot)) - fprintf(fp, "127.0.1.1\t%s.%s\t%s\n", hostname, domain_nodot, hostname); + fprintf(fp, "\n127.0.1.1\t%s.%s\t%s\n", hostname, domain_nodot, hostname); else - fprintf(fp, "127.0.1.1\t%s\n", hostname); + fprintf(fp, "\n127.0.1.1\t%s\n", hostname); +#else + fprintf(fp, "\t%s\n", hostname); +#endif } fprintf(fp, "\n" IPV6_HOSTS);