Originally, I thought the problem was caused by a function that gets
called as a normal function where we want to return a value, and as a
signal handler where we need to have it accept a parameter (the signal
number) and it returns nothing, I was going to case the function name in
the signal call as (void (*)(int)).

Looking at all the source, it turns out this function only gets used as
a signal handler, so I set an int parameter and return void.

I have removed the Linux defines because they are not needed.  BSD let
this sloppiness slide.  Linux gave a compile error.


Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
This commit is contained in:
Marc G. Fournier 1996-08-01 05:11:33 +00:00
parent 4d837e370c
commit 164ef6ff2b
2 changed files with 9 additions and 23 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
*/
#include <sys/time.h>
#ifndef WIN32
@ -95,11 +95,6 @@ PROC *MyProc = NULL;
static void ProcKill(int exitStatus, int pid);
static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
#if defined(PORTNAME_linux)
extern void HandleDeadLock(int);
#else
extern int HandleDeadLock(void);
#endif
/*
* InitProcGlobal -
* initializes the global process table. We put it here so that
@ -628,13 +623,8 @@ ProcAddLock(SHM_QUEUE *elem)
* up my semaphore.
* --------------------
*/
#if defined(PORTNAME_linux)
void
HandleDeadLock(int i)
#else
int
HandleDeadLock()
#endif
void
HandleDeadLock(int sig)
{
LOCK *lock;
int size;
@ -654,7 +644,7 @@ HandleDeadLock()
if (IpcSemaphoreGetCount(MyProc->sem.semId, MyProc->sem.semNum) ==
IpcSemaphoreDefaultStartValue) {
UnlockLockTable();
return 1;
return;
}
/*
@ -671,7 +661,7 @@ HandleDeadLock()
if (MyProc->links.prev == INVALID_OFFSET ||
MyProc->links.next == INVALID_OFFSET) {
UnlockLockTable();
return(1);
return;
}
lock = MyProc->waitLock;
@ -708,7 +698,7 @@ HandleDeadLock()
UnlockLockTable();
elog(NOTICE, "Timeout -- possible deadlock");
return 0;
return;
}
void

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: proc.h,v 1.1.1.1 1996/07/09 06:21:53 scrappy Exp $
* $Id: proc.h,v 1.2 1996/08/01 05:10:16 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -116,11 +116,7 @@ extern PROC *ProcWakeup(PROC *proc, int errType);
extern int ProcGetId(void);
extern int ProcLockWakeup(PROC_QUEUE *queue, char * ltable, char * lock);
extern void ProcAddLock(SHM_QUEUE *elem);
#if defined(PORTNAME_linux)
extern int HandleDeadLock(int);
#else
extern int HandleDeadLock(void);
#endif
extern void HandleDeadLock(int sig);
extern void ProcReleaseSpins(PROC *proc);
extern void ProcFreeAllSemaphores(void);