Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6545c64

Browse files
author
itagaki.takahiro
committed
Remove unused functions because of porting issues.
They are used by another project, but not used by pg_rman.git-svn-id:http://pg-rman.googlecode.com/svn/trunk@18 182aca00-e38e-11de-a668-6fd11605f5ce
1 parent454e8f7 commit6545c64

File tree

3 files changed

+5
-133
lines changed

3 files changed

+5
-133
lines changed

‎pgut/pgut-port.c

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -14,79 +14,6 @@
1414

1515
#include<winioctl.h>
1616

17-
int
18-
uname(structutsname*buf)
19-
{
20-
OSVERSIONINFOos= {sizeof(OSVERSIONINFO) };
21-
SYSTEM_INFOsys= { {sizeof(SYSTEM_INFO) } };
22-
DWORDbufsize;
23-
24-
GetVersionEx(&os);
25-
GetSystemInfo(&sys);
26-
27-
/* sysname */
28-
strcpy(buf->sysname,"Windows");
29-
30-
/* nodename */
31-
bufsize=lengthof(buf->nodename);
32-
GetComputerName(buf->nodename,&bufsize);
33-
34-
/* release: major.minor */
35-
snprintf(buf->release,lengthof(buf->release),"%ld.%ld",
36-
os.dwMajorVersion,os.dwMinorVersion);
37-
38-
/* version */
39-
strcpy(buf->sysname,os.szCSDVersion);
40-
41-
/* machine */
42-
switch (sys.wProcessorArchitecture)
43-
{
44-
casePROCESSOR_ARCHITECTURE_INTEL:
45-
strcpy(buf->machine,"x86");
46-
break;
47-
casePROCESSOR_ARCHITECTURE_IA64:
48-
strcpy(buf->machine,"IA64");
49-
break;
50-
casePROCESSOR_ARCHITECTURE_AMD64:
51-
strcpy(buf->machine,"x86_64");
52-
break;
53-
casePROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
54-
strcpy(buf->machine,"x86_on_win64");
55-
break;
56-
default:
57-
strcpy(buf->machine,"unknown");
58-
break;
59-
}
60-
61-
return0;
62-
}
63-
64-
#defineNTFS_BLOCK_SIZE512
65-
66-
int
67-
statfs(constchar*path,structstatfs*buf)
68-
{
69-
ULARGE_INTEGERavailBytes;
70-
ULARGE_INTEGERtotalBytes;
71-
ULARGE_INTEGERfreeBytes;
72-
73-
if (!GetDiskFreeSpaceEx(path,&availBytes,&totalBytes,&freeBytes))
74-
{
75-
_dosmaperr(GetLastError());
76-
return-1;
77-
}
78-
79-
memset(buf,0,sizeof(structstatfs));
80-
buf->f_type=NTFS_SB_MAGIC;
81-
buf->f_bsize=NTFS_BLOCK_SIZE;
82-
buf->f_blocks= (long) (totalBytes.QuadPart /NTFS_BLOCK_SIZE);
83-
buf->f_bfree= (long) (freeBytes.QuadPart /NTFS_BLOCK_SIZE);
84-
buf->f_bavail= (long) (availBytes.QuadPart /NTFS_BLOCK_SIZE);
85-
buf->f_namelen=MAX_PATH;
86-
87-
return0;
88-
}
89-
9017
#defineREPARSE_DATA_SIZE1024
9118

9219
/* same layout as REPARSE_DATA_BUFFER, which is defined only in old winnt.h */
@@ -192,20 +119,6 @@ readlink(const char *path, char *target, size_t size)
192119
returnr;
193120
}
194121

195-
char*
196-
blkid_devno_to_devname(dev_tdevno)
197-
{
198-
staticchardevname[4];
199-
charletter='A'+devno;
200-
if ('A' <=letter&&letter <='Z')
201-
{
202-
snprintf(devname,lengthof(devname),"%c:\\",'A'+devno);
203-
returndevname;
204-
}
205-
else
206-
returnNULL;
207-
}
208-
209122
int
210123
flock(intfd,intoperation)
211124
{

‎pgut/pgut-port.h

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,21 @@
1010
#ifndefPGUT_PORT_H
1111
#definePGUT_PORT_H
1212

13-
#include<sys/stat.h>
14-
15-
#ifndefWIN32
16-
17-
#include<blkid/blkid.h>
18-
#include<sys/utsname.h>
19-
#include<sys/statfs.h>
20-
#include<unistd.h>
21-
22-
#else
23-
24-
#include<time.h>
25-
26-
structutsname
27-
{
28-
charsysname[32];
29-
charnodename[256];
30-
charrelease[128];
31-
charversion[128];
32-
charmachine[32];
33-
};
34-
35-
#defineNTFS_SB_MAGIC0x5346544e
36-
37-
typedefstruct {intval[2]; }fsid_t;
38-
39-
structstatfs
40-
{
41-
longf_type;
42-
longf_bsize;
43-
longf_blocks;
44-
longf_bfree;
45-
longf_bavail;
46-
longf_files;
47-
longf_ffree;
48-
fsid_tf_fsid;
49-
longf_namelen;
50-
};
51-
52-
externintuname(structutsname*buf);
53-
externintstatfs(constchar*path,structstatfs*buf);
54-
externssize_treadlink(constchar*path,char*target,size_tsize);
55-
externchar*blkid_devno_to_devname(dev_tdevno);
13+
#ifdefWIN32
5614

5715
#defineLOCK_SH1/* Shared lock. */
5816
#defineLOCK_EX2/* Exclusive lock. */
5917
#defineLOCK_UN8/* Unlock. */
6018
#defineLOCK_NB4/* Don't block when locking. */
6119

62-
externintflock(intfd,intoperation);
63-
6420
#defineS_IFLNK(0)
6521
#defineS_IRWXG(0)
6622
#defineS_IRWXO(0)
6723
#defineS_ISLNK(mode)(0)
6824

25+
externintflock(intfd,intoperation);
26+
externssize_treadlink(constchar*path,char*target,size_tsize);
27+
6928
#endif
7029

7130
#endif/* PGUT_PORT_H */

‎pgut/pgut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,7 @@ pgut_wait(int num, PGconn *connections[], struct timeval *timeout)
10801080
for (i=0;i<num;i++)
10811081
{
10821082
intsock;
1083-
1083+
10841084
if (connections[i]==NULL)
10851085
continue;
10861086
sock=PQsocket(connections[i]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp