diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-07-14 22:35:16 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-07-14 22:35:16 +0000 |
commit | 9ca34572be8841d3673b43df827fe978b99524a5 (patch) | |
tree | a590cf0428d4997c88bc2bc24fa373b844df8f9d | |
parent | 51873f5d838d41658239d3c34f8576d7594302b8 (diff) | |
download | nspr-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.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 |