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

Commit87c0e62

Browse files
committed
New diff that now covers the entire tree. Applying this gets postgresql
working on the VERY latest version of BeOS. I'm sure there will bealot of comments, but then if there weren't I'd be disappointed!Thanks for your continuing efforts to get this into your tree.Haven't bothered with the new files as they haven't changed.BTW Peter, the compiler is "broken" about the bool define and so on.I'm filing a bug report to try and get it addressed. Hopefully then wecan tidy up the code a bit.I await the replies with interest :)David Reid
1 parentde1af06 commit87c0e62

File tree

20 files changed

+291
-60
lines changed

20 files changed

+291
-60
lines changed

‎configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ fi
660660
## Header files
661661
##
662662
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
663-
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/socket.h sys/types.h sys/un.h termios.h])
663+
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/pstat.h sys/select.h sys/socket.h sys/types.h sys/un.h termios.h])
664664

665665
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
666666
AC_CHECK_HEADERS([readline/history.h history.h], [break])

‎src/backend/commands/async.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.69 2000/10/02 19:42:45 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.70 2000/10/03 03:11:13 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -496,7 +496,6 @@ AtCommit_Notify()
496496
*/
497497
if (kill(listenerPID,SIGUSR2)<0)
498498
{
499-
500499
/*
501500
* Get rid of pg_listener entry if it refers to a PID
502501
* that no longer exists. Presumably, that backend

‎src/backend/libpq/pqcomm.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
*$Id: pqcomm.c,v 1.103 2000/10/02 21:45:31 petere Exp $
32+
*$Id: pqcomm.c,v 1.104 2000/10/03 03:11:14 momjian Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -208,11 +208,16 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
208208

209209
MemSet((char*)&saddr,0,sizeof(saddr));
210210
saddr.sa.sa_family=family;
211+
212+
/* I know this isn't a good way of testing, but until we have a
213+
* define for this it'll do!
214+
* we have Unix sockets...
215+
*/
216+
#ifdefHAVE_SYS_UN_H
211217
if (family==AF_UNIX)
212218
{
213219
len=UNIXSOCK_PATH(saddr.un,portName);
214220
strcpy(sock_path,saddr.un.sun_path);
215-
216221
/*
217222
* If the socket exists but nobody has an advisory lock on it we
218223
* can safely delete the file.
@@ -231,13 +236,16 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
231236
}
232237
#endif/* HAVE_FCNTL_SETLK */
233238
}
234-
else
235-
{
239+
#endif/* HAVE_SYS_UN_H */
240+
241+
if (family==AF_INET)
242+
{
236243
saddr.in.sin_addr.s_addr=htonl(INADDR_ANY);
237244
saddr.in.sin_port=htons(portName);
238245
len=sizeof(structsockaddr_in);
239246
}
240-
err=bind(fd,&saddr.sa,len);
247+
248+
err=bind(fd, (structsockaddr*)&saddr.sa,len);
241249
if (err<0)
242250
{
243251
snprintf(PQerrormsg,PQERRORMSG_LENGTH,
@@ -258,6 +266,7 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
258266
returnSTATUS_ERROR;
259267
}
260268

269+
#ifdefHAVE_SYS_UN_H/* yeah I know... */
261270
if (family==AF_UNIX)
262271
{
263272
on_proc_exit(StreamDoUnlink,0);
@@ -279,6 +288,7 @@ StreamServerPort(int family, unsigned short portName, int *fdP)
279288
}
280289
#endif/* HAVE_FCNTL_SETLK */
281290
}
291+
#endif/* HAVE_SYS_UN_H */
282292

283293
listen(fd,SOMAXCONN);
284294

‎src/backend/libpq/pqpacket.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.26 2000/04/12 17:15:14 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/pqpacket.c,v 1.27 2000/10/03 03:11:14 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -61,7 +61,11 @@ PacketReceiveFragment(Port *port)
6161
got=SSL_read(port->ssl,pkt->ptr,pkt->nrtodo);
6262
else
6363
#endif
64+
#ifndef__BEOS__
6465
got=read(port->sock,pkt->ptr,pkt->nrtodo);
66+
#else
67+
got=recv(port->sock,pkt->ptr,pkt->nrtodo,0);
68+
#endif/* __BEOS__ */
6569
if (got>0)
6670
{
6771
pkt->nrtodo-=got;
@@ -150,8 +154,11 @@ PacketSendFragment(Port *port)
150154
done=SSL_write(port->ssl,pkt->ptr,pkt->nrtodo);
151155
else
152156
#endif
157+
#ifndef__BEOS__
153158
done=write(port->sock,pkt->ptr,pkt->nrtodo);
154-
159+
#else
160+
done=send(port->sock,pkt->ptr,pkt->nrtodo,0);
161+
#endif
155162
if (done>0)
156163
{
157164
pkt->nrtodo-=done;

‎src/backend/main/main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.30 2000/09/06 14:15:19 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.31 2000/10/03 03:11:15 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -85,11 +85,18 @@ main(int argc, char *argv[])
8585
*/
8686
len=strlen(argv[0]);
8787

88-
if (!geteuid())
88+
/* OK this is going to seem weird, but BeOS is presently basically
89+
* a single user system. There is work going on, but at present it'll
90+
* say that every user is uid 0, i.e. root. We'll inhibit this check
91+
* until Be get the system working with multiple users!!
92+
*/
93+
#ifndef__BEOS__
94+
if (!geteuid())
8995
{
9096
fprintf(stderr,"%s",NOROOTEXEC);
9197
exit(1);
9298
}
99+
#endif/* __BEOS__ */
93100

94101
if (len >=10&& !strcmp(argv[0]+len-10,"postmaster"))
95102
exit(PostmasterMain(argc,argv));

‎src/backend/port/dynloader/beos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.1 2000/10/02 17:15:53 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/Attic/beos.c,v 1.2 2000/10/03 03:11:15 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/

‎src/backend/port/dynloader/beos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: beos.h,v 1.1 2000/10/02 17:15:53 momjian Exp $
10+
* $Id: beos.h,v 1.2 2000/10/03 03:11:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.167 2000/10/02 19:42:46 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.168 2000/10/03 03:11:16 momjian Exp $
1515
*
1616
* NOTES
1717
*
@@ -818,13 +818,12 @@ ServerLoop(void)
818818
if (select(nSockets,&rmask,&wmask, (fd_set*)NULL,
819819
(structtimeval*)NULL)<0)
820820
{
821-
if (errno==EINTR)
821+
if (errno==EINTR||errno==EWOULDBLOCK)
822822
continue;
823823
fprintf(stderr,"%s: ServerLoop: select failed: %s\n",
824824
progname,strerror(errno));
825825
returnSTATUS_ERROR;
826826
}
827-
828827
/*
829828
* Select a random seed at the time of first receiving a request.
830829
*/
@@ -1021,7 +1020,6 @@ initMasks(fd_set *rmask, fd_set *wmask)
10211020
if (ServerSock_INET!=INVALID_SOCK)
10221021
{
10231022
FD_SET(ServerSock_INET,rmask);
1024-
10251023
if (ServerSock_INET>nsocks)
10261024
nsocks=ServerSock_INET;
10271025
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp