diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/libpq/pqcomm.c | 18 | ||||
| -rw-r--r-- | src/backend/utils/init/miscinit.c | 27 | ||||
| -rw-r--r-- | src/include/pg_config.h.in | 9 | ||||
| -rw-r--r-- | src/include/port/win32_msvc/utime.h | 2 | ||||
| -rw-r--r-- | src/include/port/win32_port.h | 1 | ||||
| -rw-r--r-- | src/tools/msvc/Solution.pm | 3 |
6 files changed, 6 insertions, 54 deletions
diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 10bf13f997d..7717bb27195 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -81,9 +81,7 @@ #ifdef HAVE_NETINET_TCP_H #include <netinet/tcp.h> #endif -#ifdef HAVE_UTIME_H #include <utime.h> -#endif #ifdef _MSC_VER /* mstcpip.h is missing on mingw */ #include <mstcpip.h> #endif @@ -866,20 +864,8 @@ TouchSocketFiles(void) { char *sock_path = (char *) lfirst(l); - /* - * utime() is POSIX standard, utimes() is a common alternative. If we - * have neither, there's no way to affect the mod or access time of - * the socket :-( - * - * In either path, we ignore errors; there's no point in complaining. - */ -#ifdef HAVE_UTIME - utime(sock_path, NULL); -#else /* !HAVE_UTIME */ -#ifdef HAVE_UTIMES - utimes(sock_path, NULL); -#endif /* HAVE_UTIMES */ -#endif /* HAVE_UTIME */ + /* Ignore errors; there's no point in complaining */ + (void) utime(sock_path, NULL); } } diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c index c7c9bef617e..b02bad44203 100644 --- a/src/backend/utils/init/miscinit.c +++ b/src/backend/utils/init/miscinit.c @@ -26,9 +26,7 @@ #include <pwd.h> #include <netinet/in.h> #include <arpa/inet.h> -#ifdef HAVE_UTIME_H #include <utime.h> -#endif #include "access/htup_details.h" #include "catalog/pg_authid.h" @@ -1213,29 +1211,8 @@ TouchSocketLockFiles(void) if (strcmp(socketLockFile, DIRECTORY_LOCK_FILE) == 0) continue; - /* - * utime() is POSIX standard, utimes() is a common alternative; if we - * have neither, fall back to actually reading the file (which only - * sets the access time not mod time, but that should be enough in - * most cases). In all paths, we ignore errors. - */ -#ifdef HAVE_UTIME - utime(socketLockFile, NULL); -#else /* !HAVE_UTIME */ -#ifdef HAVE_UTIMES - utimes(socketLockFile, NULL); -#else /* !HAVE_UTIMES */ - int fd; - char buffer[1]; - - fd = open(socketLockFile, O_RDONLY | PG_BINARY, 0); - if (fd >= 0) - { - read(fd, buffer, sizeof(buffer)); - close(fd); - } -#endif /* HAVE_UTIMES */ -#endif /* HAVE_UTIME */ + /* we just ignore any error here */ + (void) utime(socketLockFile, NULL); } } diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index e3e74728204..20700cb85a9 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -662,15 +662,6 @@ /* Define to 1 if you have the `uselocale' function. */ #undef HAVE_USELOCALE -/* Define to 1 if you have the `utime' function. */ -#undef HAVE_UTIME - -/* Define to 1 if you have the `utimes' function. */ -#undef HAVE_UTIMES - -/* Define to 1 if you have the <utime.h> header file. */ -#undef HAVE_UTIME_H - /* Define to 1 if you have BSD UUID support. */ #undef HAVE_UUID_BSD diff --git a/src/include/port/win32_msvc/utime.h b/src/include/port/win32_msvc/utime.h index dd1b103eaef..c78e79c33d3 100644 --- a/src/include/port/win32_msvc/utime.h +++ b/src/include/port/win32_msvc/utime.h @@ -1 +1,3 @@ /* src/include/port/win32_msvc/utime.h */ + +#include <sys/utime.h> /* for non-unicode version */ diff --git a/src/include/port/win32_port.h b/src/include/port/win32_port.h index 91ec01468e8..8b6576b23dc 100644 --- a/src/include/port/win32_port.h +++ b/src/include/port/win32_port.h @@ -50,7 +50,6 @@ #include <process.h> #include <signal.h> #include <direct.h> -#include <sys/utime.h> /* for non-unicode version */ #undef near #include <sys/stat.h> /* needed before sys/stat hacking below */ diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index cb03d03a971..151a41ad5b6 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -390,9 +390,6 @@ sub GenerateFiles HAVE_UNIX_SOCKETS => undef, HAVE_UNSETENV => undef, HAVE_USELOCALE => undef, - HAVE_UTIME => 1, - HAVE_UTIMES => undef, - HAVE_UTIME_H => 1, HAVE_UUID_BSD => undef, HAVE_UUID_E2FS => undef, HAVE_UUID_OSSP => undef, |
