git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f2789ab)
Remove no-longer-referenced src/port/gethostname.c.
2015年1月24日 17:13:57 +0000 (12:13 -0500)
2015年1月24日 17:13:57 +0000 (12:13 -0500)
This file hasn't been part of any build since 2005, and even before that
wasn't used unless you configured --with-krb4 (and had a machine without
gethostname(2), obviously). What's more, we haven't actually called
gethostname anywhere since then, either (except in thread_test.c, whose
testing of this function is probably pointless). So we don't need it.


diff --git a/src/port/gethostname.c b/src/port/gethostname.c
deleted file mode 100644 (file)
index 51bdfc8..0000000
--- a/src/port/gethostname.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * gethostname.c
- * gethostname using uname
- *
- * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * IDENTIFICATION
- * src/port/gethostname.c
- *
- *-------------------------------------------------------------------------
- */
-
-#include "c.h"
-
-#include <sys/utsname.h>
-
-int
-gethostname(char *name, int namelen)
-{
- static struct utsname mname;
- static int called = 0;
-
- if (!called)
- {
- called++;
- uname(&mname);
- }
- strncpy(name, mname.nodename, (SYS_NMLN < namelen ? SYS_NMLN : namelen));
-
- return 0;
-}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /