rem: DBG("DEBUG: lock_initialize: transaction timer semaphore allocation failure\n");
add: LOG(L_ERR, "ERROR: lock_initialize:  transaction timer semaphore initialization failure\n");
context: int lock_initialize(){	int i;	int probe_run;	/* first try allocating semaphore sets with fixed number of semaphores */	DBG("DEBUG: lock_initialize: lock initialization started\n");	/* transaction timers */	if ((transaction_timer_semaphore=init_semaphore_set( NR_OF_TIMER_LISTS) ) < 0) {		DBG("DEBUG: lock_initialize: transaction timer semaphore allocation failure\n");		goto error;	}	/* message retransmission timers        if ((retrasmission_timer_semaphore=init_semaphore_set( NR_OF_RT_LISTS) ) < 0) {                DBG("DEBUG: lock_initialize:  retransmission timer semaphore initialization failure\n");                goto error;        } */	i=SEM_MIN;	/* probing phase: 0=initial, 1=after the first failure */	probe_run=0;	do {		if (entry_semaphore>0) /* clean-up previous attempt */			semctl( entry_semaphore, 0 , IPC_RMID , 0 );		entry_semaphore=init_semaphore_set( i );		if (entry_semaphore==-1) {                        printf("ERROR: entry semaphore initialization failure:  %s\n", strerror( errno ) );			/* Solaris: EINVAL, Linux: ENOSPC */                        if (errno==EINVAL || errno==ENOSPC ) {                                /* first time: step back and try again */                                if (probe_run==0) {					DBG("DEBUG: lock_initialize: first time sempahore allocation failure\n");                                        i--;                                        probe_run=1;                                        continue;				/* failure after we stepped back; give up */                                } else {					DBG("DEBUG: lock_initialize: second time sempahore allocation failure\n");					goto error;				}                        }			/* some other error occured: give up */                        goto error;                }		/* allocation succeeded */		if (probe_run==1) { /* if ok after we stepped back, we're done */			break;		} else { /* if ok otherwiese, try again with larger set */			if (i==SEM_MAX) break;			else {				i++;				continue;			}		}	} while(1);	sem_nr=i;		/* return success */	printf("INFO: %d entry semaphores allocated\n", sem_nr );	return 0;error:	lock_cleanup();	return -1;}