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

Commit164ef6f

Browse files
committed
Fixes:
Originally, I thought the problem was caused by a function that getscalled as a normal function where we want to return a value, and as asignal handler where we need to have it accept a parameter (the signalnumber) and it returns nothing, I was going to case the function name inthe signal call as (void (*)(int)).Looking at all the source, it turns out this function only gets used asa signal handler, so I set an int parameter and return void.I have removed the Linux defines because they are not needed. BSD letthis sloppiness slide. Linux gave a compile error.Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
1 parent4d837e3 commit164ef6f

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

‎src/backend/storage/lmgr/proc.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -46,7 +46,7 @@
4646
* This is so that we can support more backends. (system-wide semaphore
4747
* sets run out pretty fast.) -ay 4/95
4848
*
49-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
49+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
5050
*/
5151
#include<sys/time.h>
5252
#ifndefWIN32
@@ -95,11 +95,6 @@ PROC *MyProc = NULL;
9595
staticvoidProcKill(intexitStatus,intpid);
9696
staticvoidProcGetNewSemKeyAndNum(IPCKey*key,int*semNum);
9797
staticvoidProcFreeSem(IpcSemaphoreKeysemKey,intsemNum);
98-
#if defined(PORTNAME_linux)
99-
externvoidHandleDeadLock(int);
100-
#else
101-
externintHandleDeadLock(void);
102-
#endif
10398
/*
10499
* InitProcGlobal -
105100
* initializes the global process table. We put it here so that
@@ -628,13 +623,8 @@ ProcAddLock(SHM_QUEUE *elem)
628623
* up my semaphore.
629624
* --------------------
630625
*/
631-
#if defined(PORTNAME_linux)
632-
void
633-
HandleDeadLock(inti)
634-
#else
635-
int
636-
HandleDeadLock()
637-
#endif
626+
void
627+
HandleDeadLock(intsig)
638628
{
639629
LOCK*lock;
640630
intsize;
@@ -654,7 +644,7 @@ HandleDeadLock()
654644
if (IpcSemaphoreGetCount(MyProc->sem.semId,MyProc->sem.semNum)==
655645
IpcSemaphoreDefaultStartValue) {
656646
UnlockLockTable();
657-
return1;
647+
return;
658648
}
659649

660650
/*
@@ -671,7 +661,7 @@ HandleDeadLock()
671661
if (MyProc->links.prev==INVALID_OFFSET||
672662
MyProc->links.next==INVALID_OFFSET) {
673663
UnlockLockTable();
674-
return(1);
664+
return;
675665
}
676666

677667
lock=MyProc->waitLock;
@@ -708,7 +698,7 @@ HandleDeadLock()
708698
UnlockLockTable();
709699

710700
elog(NOTICE,"Timeout -- possible deadlock");
711-
return0;
701+
return;
712702
}
713703

714704
void

‎src/backend/storage/proc.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: proc.h,v 1.1.1.1 1996/07/09 06:21:53 scrappy Exp $
9+
* $Id: proc.h,v 1.2 1996/08/01 05:10:16 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -116,11 +116,7 @@ extern PROC *ProcWakeup(PROC *proc, int errType);
116116
externintProcGetId(void);
117117
externintProcLockWakeup(PROC_QUEUE*queue,char*ltable,char*lock);
118118
externvoidProcAddLock(SHM_QUEUE*elem);
119-
#if defined(PORTNAME_linux)
120-
externintHandleDeadLock(int);
121-
#else
122-
externintHandleDeadLock(void);
123-
#endif
119+
externvoidHandleDeadLock(intsig);
124120
externvoidProcReleaseSpins(PROC*proc);
125121
externvoidProcFreeAllSemaphores(void);
126122

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp