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
e36ba278
Commit
e36ba278
authored
Oct 29, 1992
by
Richard M. Stallman
Browse files
(get_system_name): Use gethostname for USG systems
if HAVE_GETHOSTNAME is defined.
parent
94aa5d2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/sysdep.c
src/sysdep.c
+12
-2
No files found.
src/sysdep.c
View file @
e36ba278
...
...
@@ -1539,17 +1539,27 @@ end_of_data ()
#include <whoami.h>
#endif
/* Can't have this within the function since `static' is #defined to
nothing for some USG systems. */
#ifdef USG
/* Can't have this within the function since `static' is #defined to nothing */
#ifdef HAVE_GETHOSTNAME
static char get_system_name_name[256];
#else /* not HAVE_GETHOSTNAME */
static struct utsname get_system_name_name;
#endif
#endif /* not HAVE_GETHOSTNAME */
#endif /* USG */
char *
get_system_name ()
{
#ifdef USG
#ifdef HAVE_GETHOSTNAME
gethostname (get_system_name_name, sizeof (get_system_name_name));
return get_system_name_name;
#else /* not HAVE_GETHOSTNAME */
uname (&get_system_name_name);
return (get_system_name_name.nodename);
#endif /* not HAVE_GETHOSTNAME */
#else /* Not USG */
#ifdef BSD4_1
return sysname;
...
...
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