diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-07-14 22:33:47 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-07-14 22:33:47 +0000 |
commit | fd020333e4f9bf14cb6bce299c2c25b2cd66b932 (patch) | |
tree | c2ded8c28c70563c0970094c1460fa0fa5dd29d8 | |
parent | 8a9fa5b97cd9c231113589595fc838bd8ccd0fd0 (diff) | |
download | nspr-hg-fd020333e4f9bf14cb6bce299c2c25b2cd66b932.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: NSPR_4_6_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 |