diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-03 20:46:48 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-08 17:46:15 -0800 |
commit | ac1eb6e3ea54724cf3ab3ad1ccf0595df9e34786 (patch) | |
tree | 9f0839631a7461e463337f07ceb307f6e52bdc03 | |
parent | a4c12fe0ca5cb359bffe08b26a92ddcf8e194441 (diff) |
Remove unused internal helper _FSGetHostname
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.
Xtrans provides it's own exact copy of this function, which gets
the name _FSTransGetHostname when built in libFS, nothing in libFS
outside the Xtrans code calls a gethostname() function.
Flagged by cppcheck 1.62:
[FSlibInt.c:1060]: (style) The function '_FSGetHostname' is never used.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
-rw-r--r-- | src/FSlibInt.c | 51 | ||||
-rw-r--r-- | src/FSlibint.h | 1 |
2 files changed, 0 insertions, 52 deletions
diff --git a/src/FSlibInt.c b/src/FSlibInt.c index cb53e44..cd996d1 100644 --- a/src/FSlibInt.c +++ b/src/FSlibInt.c @@ -1034,57 +1034,6 @@ _FSFreeQ(void) return; } -#ifdef _POSIX_SOURCE /* stupid makedepend [need if] */ -#ifndef __QNX__ /* QNX's uname nodename entry is not same as tcpip hostname */ -#define NEED_UTSNAME -#endif -#endif -#ifdef hpux -#define NEED_UTSNAME -#endif -#ifdef SVR4 -#ifndef _SEQUENT_ -#define NEED_UTSNAME -#endif -#endif - -#ifdef NEED_UTSNAME -#include <sys/utsname.h> -#endif - - -/* - * _FSGetHostname - similar to gethostname but allows special processing. - */ -int -_FSGetHostname( - char *buf, - int maxlen) -{ - int len; - -#ifdef NEED_UTSNAME - /* - * same host name crock as in server and xinit. - */ - struct utsname name; - - uname(&name); - len = strlen(name.nodename); - if (len >= maxlen) - len = maxlen - 1; - strncpy(buf, name.nodename, len); - buf[len] = '\0'; -#else - buf[0] = '\0'; - (void) gethostname(buf, maxlen); - buf[maxlen - 1] = '\0'; - len = strlen(buf); -#endif /* NEED_UTSNAME */ - - return len; -} - #ifndef _FSANYSET /* * This is not always a macro. diff --git a/src/FSlibint.h b/src/FSlibint.h index 60a2ce6..7669778 100644 --- a/src/FSlibint.h +++ b/src/FSlibint.h @@ -95,7 +95,6 @@ extern int _FSPrintDefaultError ( FSServer *svr, FSErrorEvent *event, extern int _FSDefaultError ( FSServer *svr, FSErrorEvent *event ); extern char * _FSAllocScratch ( FSServer *svr, unsigned long nbytes ); extern void _FSFreeQ ( void ); -extern int _FSGetHostname ( char *buf, int maxlen ); extern FSErrorHandler FSSetErrorHandler ( FSErrorHandler handler ); extern FSIOErrorHandler FSSetIOErrorHandler ( FSIOErrorHandler handler ); |