projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a940963
)
Deprecate uname() in favour of (Posix) gethostname().
author
Lyndon Nerenberg
<lyndon@orthanc.ca>
Sat, 24 Dec 2011 23:30:53 +0000
(15:30 -0800)
committer
Ken Hornstein
<kenh@pobox.com>
Wed, 4 Jan 2012 01:23:40 +0000
(20:23 -0500)
sbr/mts.c
patch
|
blob
|
history
diff --git
a/sbr/mts.c
b/sbr/mts.c
index
15f182c
..
37f6e23
100644
(file)
--- a/
sbr/mts.c
+++ b/
sbr/mts.c
@@
-20,10
+20,6
@@
#include <sys/socket.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netdb.h>
-#ifdef HAVE_SYS_UTSNAME_H
-# include <sys/utsname.h>
-#endif
-
#define NOTOK (-1)
#define OK 0
#define NOTOK (-1)
#define OK 0
@@
-250,9
+246,6
@@
LocalName (void)
{
static char buffer[BUFSIZ] = "";
struct addrinfo hints, *res;
{
static char buffer[BUFSIZ] = "";
struct addrinfo hints, *res;
-#ifdef HAVE_UNAME
- struct utsname name;
-#endif
/* check if we have cached the local name */
if (buffer[0])
/* check if we have cached the local name */
if (buffer[0])
@@
-265,14
+258,8
@@
LocalName (void)
strncpy (buffer, localname, sizeof(buffer));
} else {
memset(buffer, 0, sizeof(buffer));
strncpy (buffer, localname, sizeof(buffer));
} else {
memset(buffer, 0, sizeof(buffer));
-#ifdef HAVE_UNAME
- /* first get our local name */
- uname (&name);
- strncpy (buffer, name.nodename, sizeof(buffer) - 1);
-#else
/* first get our local name */
gethostname (buffer, sizeof(buffer) - 1);
/* first get our local name */
gethostname (buffer, sizeof(buffer) - 1);
-#endif
/* now fully qualify our name */
memset(&hints, 0, sizeof(hints));
/* now fully qualify our name */
memset(&hints, 0, sizeof(hints));
@@
-307,10
+294,6
@@
SystemName (void)
{
static char buffer[BUFSIZ] = "";
{
static char buffer[BUFSIZ] = "";
-#ifdef HAVE_UNAME
- struct utsname name;
-#endif
-
/* check if we have cached the system name */
if (buffer[0])
return buffer;
/* check if we have cached the system name */
if (buffer[0])
return buffer;
@@
-323,12
+306,7
@@
SystemName (void)
return buffer;
}
return buffer;
}
-#ifdef HAVE_UNAME
- uname (&name);
- strncpy (buffer, name.nodename, sizeof(buffer));
-#else
gethostname (buffer, sizeof(buffer));
gethostname (buffer, sizeof(buffer));
-#endif
return buffer;
}
return buffer;
}