summaryrefslogtreecommitdiffstats
path: root/libexec/bootpd
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1998-06-03 20:01:28 +0000
committerjoerg <joerg@FreeBSD.org>1998-06-03 20:01:28 +0000
commit76360747fe6024fe1487fde77cf6bf9c41567f42 (patch)
tree5dfc5be589166496c458c404b8a65649843016e9 /libexec/bootpd
parent04e2e080ec8c13babbf385eaa1b2daaaf4660612 (diff)
downloadFreeBSD-src-76360747fe6024fe1487fde77cf6bf9c41567f42.zip
FreeBSD-src-76360747fe6024fe1487fde77cf6bf9c41567f42.tar.gz
Use gethostname(3) to obtain the local host name, as opposed to uname(3).
Otherwise the length of the name is limited to 32 characters only.
Diffstat (limited to 'libexec/bootpd')
-rw-r--r--libexec/bootpd/bootpd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libexec/bootpd/bootpd.c b/libexec/bootpd/bootpd.c
index 0fe07e1..68e35d5 100644
--- a/libexec/bootpd/bootpd.c
+++ b/libexec/bootpd/bootpd.c
@@ -19,7 +19,7 @@ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
- $Id: bootpd.c,v 1.6 1997/02/22 14:21:02 peter Exp $
+ $Id: bootpd.c,v 1.7 1997/05/11 14:27:03 phk Exp $
************************************************************************/
@@ -162,8 +162,7 @@ char *progname;
char *chdir_path;
struct in_addr my_ip_addr;
-struct utsname my_uname;
-char *hostname;
+char *hostname, default_hostname[MAXHOSTNAMELEN + 1];
/* Flags set by signal catcher. */
PRIVATE int do_readtab = 0;
@@ -256,11 +255,11 @@ main(argc, argv)
stmp = NULL;
timeout = &actualtimeout;
- if (uname(&my_uname) < 0) {
+ if (gethostname(default_hostname, MAXHOSTNAMELEN) < 0) {
report(LOG_ERR, "bootpd: can't get hostname\n");
exit(1);
}
- hostname = my_uname.nodename;
+ hostname = default_hostname;
/*
* Read switches.
OpenPOWER on IntegriCloud