diff options
| author | Tom Lane | 2020-02-21 19:04:19 +0000 |
|---|---|---|
| committer | Tom Lane | 2020-02-21 19:30:47 +0000 |
| commit | 481c8e9232386e289fbd3e8f75893ae8d9814298 (patch) | |
| tree | 34c0aa0246b7333019d6a8c8326381f6d9599436 /src/backend/libpq/pqcomm.c | |
| parent | f88a058200a40032e88a8bfc1aea453c22d2dcb0 (diff) | |
Assume that we have utime() and <utime.h>.
These are required by POSIX since SUSv2, and no live platforms fail
to provide them. On Windows, utime() exists and we bring our own
<utime.h>, so we're good there too. So remove the configure probes
and ad-hoc substitute code. We don't need to check for utimes()
anymore either, since that was only used as a substitute.
In passing, make the Windows build include <sys/utime.h> only where
we need it, not everywhere.
This is part of a series of commits to get rid of no-longer-relevant
configure checks and dead src/port/ code. I'm committing them separately
to make it easier to back out individual changes if they prove less
portable than I expect.
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/libpq/pqcomm.c')
| -rw-r--r-- | src/backend/libpq/pqcomm.c | 18 |
1 files changed, 2 insertions, 16 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); } } |
