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

Commit2010a43

Browse files
committed
Cope with case that SEM_FAILED is not defined (assume failure code is -1)
1 parent8df5625 commit2010a43

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/port/posix_sema.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/port/posix_sema.c,v 1.2 2002/05/05 01:03:26 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/port/posix_sema.c,v 1.3 2002/05/0516:01:50 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -72,8 +72,14 @@ PosixSemaphoreCreate(void)
7272

7373
mySem=sem_open(semname,O_CREAT |O_EXCL,
7474
(mode_t)IPCProtection, (unsigned)1);
75+
76+
#ifdefSEM_FAILED
7577
if (mySem!= (sem_t*)SEM_FAILED)
7678
break;
79+
#else
80+
if (mySem!= (sem_t*) (-1))
81+
break;
82+
#endif
7783

7884
/* Loop if error indicates a collision */
7985
if (errno==EEXIST||errno==EACCES||errno==EINTR)
@@ -82,7 +88,7 @@ PosixSemaphoreCreate(void)
8288
/*
8389
* Else complain and abort
8490
*/
85-
fprintf(stderr,"PosixSemaphoreCreate: sem_open(%s) failed: %s\n",
91+
fprintf(stderr,"PosixSemaphoreCreate: sem_open(\"%s\") failed: %s\n",
8692
semname,strerror(errno));
8793
proc_exit(1);
8894
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp