diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-01-19 22:14:40 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-01-19 22:14:40 +0000 |
commit | 7a45c5160d1504cddf7d6da2afc7487153bf2cce (patch) | |
tree | a758a792d976d72b2bd69081b71ec2aa2f2fa6cb | |
parent | 3526d01d1784e975d1418dd4567b4ee899a1d6f0 (diff) | |
download | nspr-hg-7a45c5160d1504cddf7d6da2afc7487153bf2cce.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.
Modified files: prsystem.h prsystem.c
Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r-- | pr/include/prsystem.h | 7 | ||||
-rw-r--r-- | pr/src/misc/prsystem.c | 4 |
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 |