1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-17 21:18:00 +02:00

Use lockf on XLC.

This commit is contained in:
stalkerg 2016-12-08 14:42:32 +03:00
parent 25445d9993
commit f7d1da953e

View File

@ -43,7 +43,11 @@ catalog_lock(void)
elog(errno == ENOENT ? ERROR : ERROR,
"cannot open file \"%s\": %s", id_path, strerror(errno));
#ifdef __IBMC__
ret = lockf(lock_fd, LOCK_EX | LOCK_NB, 0); /* non-blocking */
#else
ret = flock(lock_fd, LOCK_EX | LOCK_NB); /* non-blocking */
#endif
if (ret == -1)
{
if (errno == EWOULDBLOCK)