Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f8a80313
Commit
f8a80313
authored
May 26, 1993
by
Richard M. Stallman
Browse files
[HAVE_SOCKETS]: Include socket.h, netdb.h.
(get_system_name) [HAVE_SOCKETS]: Use gethostbyname.
parent
c12710e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
src/sysdep.c
src/sysdep.c
+25
-0
No files found.
src/sysdep.c
View file @
f8a80313
...
...
@@ -1712,6 +1712,17 @@ static struct utsname get_system_name_name;
#endif
/* not HAVE_GETHOSTNAME */
#endif
/* USG */
#ifndef BSD4_1
#ifndef USG
#ifndef VMS
#ifdef HAVE_SOCKETS
#include <sys/socket.h>
#include <netdb.h>
#endif
/* HAVE_SOCKETS */
#endif
/* not VMS */
#endif
/* not USG */
#endif
/* not BSD4_1 */
char
*
get_system_name
()
{
...
...
@@ -1742,6 +1753,20 @@ get_system_name ()
strcpy
(
system_name_saved
,
sp
);
#else
/* not VMS */
gethostname
(
system_name_saved
,
sizeof
(
system_name_saved
));
#ifdef HAVE_SOCKETS
/* Turn the hostname into the official, fully-qualified hostname.
Don't do this if we're going to dump; this can confuse system
libraries on some machines and make the dumped emacs core dump. */
#ifndef CANNOT_DUMP
if
(
initialized
)
#endif
/* not CANNOT_DUMP */
{
struct
hostent
*
hp
;
hp
=
gethostbyname
(
system_name_saved
);
if
(
hp
&&
strlen
(
hp
->
h_name
)
<
sizeof
(
system_name_saved
))
strcpy
(
system_name_saved
,
hp
->
h_name
);
}
#endif
/* HAVE_SOCKETS */
#endif
/* not VMS */
return
system_name_saved
;
#endif
/* not USG, not 4.1 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment