summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2006-07-14 22:35:16 +0000
committerwtchang%redhat.com <devnull@localhost>2006-07-14 22:35:16 +0000
commit9ca34572be8841d3673b43df827fe978b99524a5 (patch)
treea590cf0428d4997c88bc2bc24fa373b844df8f9d
parent51873f5d838d41658239d3c34f8576d7594302b8 (diff)
downloadnspr-hg-9ca34572be8841d3673b43df827fe978b99524a5.tar.gz
Bugzilla Bug 322956: added PR_SI_HOSTNAME_UNTRUNCATED, which does not
strip the domain name (if any). The patch is contributed by Philip Prindeville <philipp@redfish-solutions.com>. r=wtc,darin. a=dbaron. Modified files: prsystem.h prsystem.c Tag: MOZILLA_1_8_BRANCH
-rw-r--r--pr/include/prsystem.h7
-rw-r--r--pr/src/misc/prsystem.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/pr/include/prsystem.h b/pr/include/prsystem.h
index b0dfcf9e..13cf8bab 100644
--- a/pr/include/prsystem.h
+++ b/pr/include/prsystem.h
@@ -70,10 +70,13 @@ NSPR_API(char) PR_GetPathSeparator(void);
/* Types of information available via PR_GetSystemInfo(...) */
typedef enum {
- PR_SI_HOSTNAME,
+ PR_SI_HOSTNAME, /* the hostname with the domain name (if any)
+ * removed */
PR_SI_SYSNAME,
PR_SI_RELEASE,
- PR_SI_ARCHITECTURE
+ PR_SI_ARCHITECTURE,
+ PR_SI_HOSTNAME_UNTRUNCATED /* the hostname exactly as configured
+ * on the system */
} PRSysInfo;
diff --git a/pr/src/misc/prsystem.c b/pr/src/misc/prsystem.c
index 40c6eaac..1c6c2825 100644
--- a/pr/src/misc/prsystem.c
+++ b/pr/src/misc/prsystem.c
@@ -134,8 +134,12 @@ PR_IMPLEMENT(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 bufle
switch(cmd)
{
case PR_SI_HOSTNAME:
+ case PR_SI_HOSTNAME_UNTRUNCATED:
if (PR_FAILURE == _PR_MD_GETHOSTNAME(buf, (PRUintn)buflen))
return PR_FAILURE;
+
+ if (cmd == PR_SI_HOSTNAME_UNTRUNCATED)
+ break;
/*
* On some platforms a system does not have a hostname and
* its IP address is returned instead. The following code