Remove a redundant getdomainname() implementation.

This commit is contained in:
Kees van Reeuwijk 2010-04-26 12:43:43 +00:00
parent aacbfc41cc
commit 5b0efc542f
2 changed files with 0 additions and 31 deletions

View File

@ -8,7 +8,6 @@ SRCS+= \
connect.c \ connect.c \
dhcp_gettag.c \ dhcp_gettag.c \
dhcp_settag.c \ dhcp_settag.c \
domainname.c \
ether_line.c \ ether_line.c \
ethera2n.c \ ethera2n.c \
ethere2a.c \ ethere2a.c \

View File

@ -1,30 +0,0 @@
/*
domainname.c
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int getdomainname(domain, size)
char *domain;
size_t size;
{
FILE *domainfile;
char *line;
domainfile= fopen("/etc/domainname", "r");
if (!domainfile)
{
return -1;
}
line= fgets(domain, size, domainfile);
fclose(domainfile);
if (!line)
return -1;
line= strchr(domain, '\n');
if (line)
*line= '\0';
return 0;
}