mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-11-24 08:52:38 +02:00
remove unused pgut-port files
This commit is contained in:
parent
d41c11d55e
commit
1315723dc5
1
Makefile
1
Makefile
@ -19,7 +19,6 @@ OBJS = backup.o \
|
||||
streamutil.o \
|
||||
receivelog.o \
|
||||
pgut/pgut.o \
|
||||
pgut/pgut-port.o \
|
||||
pgut/getopt_long.o
|
||||
|
||||
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.c receivelog.h streamutil.c streamutil.h logging.h
|
||||
|
1
backup.c
1
backup.c
@ -21,7 +21,6 @@
|
||||
#include <pthread.h>
|
||||
|
||||
#include "libpq/pqsignal.h"
|
||||
#include "pgut/pgut-port.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "datapagemap.h"
|
||||
#include "streamutil.h"
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "pgut/pgut-port.h"
|
||||
|
||||
static pgBackup *read_backup_from_file(const char *path);
|
||||
|
||||
#define BOOL_TO_STR(val) ((val) ? "true" : "false")
|
||||
|
1
dir.c
1
dir.c
@ -17,7 +17,6 @@
|
||||
#include <dirent.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "pgut/pgut-port.h"
|
||||
#include "datapagemap.h"
|
||||
|
||||
/*
|
||||
|
@ -1,82 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* pgut-port.c
|
||||
*
|
||||
* Copyright (c) 2009-2010, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "c.h"
|
||||
#include "pgut-port.h"
|
||||
|
||||
#undef flock
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef PGUT_FLOCK
|
||||
|
||||
#ifdef WIN32
|
||||
int
|
||||
pgut_flock(int fd, int operation)
|
||||
{
|
||||
BOOL ret;
|
||||
HANDLE handle = (HANDLE) _get_osfhandle(fd);
|
||||
DWORD lo = 0;
|
||||
DWORD hi = 0;
|
||||
|
||||
if (operation & LOCK_UN)
|
||||
{
|
||||
ret = UnlockFileEx(handle, 0, lo, hi, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD flags = 0;
|
||||
if (operation & LOCK_EX)
|
||||
flags |= LOCKFILE_EXCLUSIVE_LOCK;
|
||||
if (operation & LOCK_NB)
|
||||
flags |= LOCKFILE_FAIL_IMMEDIATELY;
|
||||
ret = LockFileEx(handle, flags, 0, lo, hi, NULL);
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
_dosmaperr(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
pgut_flock(int fd, int operation)
|
||||
{
|
||||
struct flock lck;
|
||||
int cmd;
|
||||
|
||||
memset(&lck, 0, sizeof(lck));
|
||||
lck.l_whence = SEEK_SET;
|
||||
lck.l_start = 0;
|
||||
lck.l_len = 0;
|
||||
lck.l_pid = getpid();
|
||||
|
||||
if (operation & LOCK_UN)
|
||||
lck.l_type = F_UNLCK;
|
||||
else if (operation & LOCK_EX)
|
||||
lck.l_type = F_WRLCK;
|
||||
else
|
||||
lck.l_type = F_RDLCK;
|
||||
|
||||
if (operation & LOCK_NB)
|
||||
cmd = F_SETLK;
|
||||
else
|
||||
cmd = F_SETLKW;
|
||||
|
||||
return fcntl(fd, cmd, &lck);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,36 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* pgut-port.h
|
||||
*
|
||||
* Copyright (c) 2009-2010, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef PGUT_PORT_H
|
||||
#define PGUT_PORT_H
|
||||
|
||||
/*
|
||||
* flock ports
|
||||
*/
|
||||
#ifndef LOCK_EX
|
||||
|
||||
#define PGUT_FLOCK
|
||||
|
||||
#undef LOCK_SH
|
||||
#undef LOCK_EX
|
||||
#undef LOCK_UN
|
||||
#undef LOCK_NB
|
||||
|
||||
#define LOCK_SH 1 /* Shared lock. */
|
||||
#define LOCK_EX 2 /* Exclusive lock. */
|
||||
#define LOCK_UN 8 /* Unlock. */
|
||||
#define LOCK_NB 4 /* Don't block when locking. */
|
||||
|
||||
extern int pgut_flock(int fd, int operation);
|
||||
|
||||
#define flock pgut_flock
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PGUT_PORT_H */
|
Loading…
Reference in New Issue
Block a user