~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to src/libs/zbxsys/mutexs.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-06-04 09:22:37 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080604092237-zgwq7kmraj1oohoz
Tags: 1:1.4.5-1ubuntu1
* Merge from debian unstable, remaining changes: 
  + fixing missing pid directory in /var/run
* Added the same patch to debian/zabbix-server-{mysql,pgsql}.zabbix-server.init
  (LP: #172775)

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        }
115
115
        else if(errno == EEXIST)
116
116
        {
117
 
                zabbix_log(LOG_LEVEL_DEBUG, "ZABBIX semaphores already exists, trying to recreate.");
 
117
                zabbix_log(LOG_LEVEL_WARNING, "ZABBIX semaphores already exist, trying to recreate.");
118
118
 
119
119
                ZBX_SEM_LIST_ID = semget(sem_key, 0 /* get reference */, 0666 /* 0022 */);
120
120
 
121
121
                if(forced) {
122
 
                        semctl(ZBX_SEM_LIST_ID, 0, IPC_RMID, 0);
 
122
                        if( 0 != semctl(ZBX_SEM_LIST_ID, 0, IPC_RMID, 0))
 
123
                        {
 
124
                                zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores for IPC key 0x%lx Semaphore ID %ld. %s.",
 
125
                                        sem_key,
 
126
                                        ZBX_SEM_LIST_ID,
 
127
                                        strerror(errno));
 
128
                                exit(1);
 
129
                        }
123
130
 
124
131
                        if ( ++attempts > ZBX_MAX_ATTEMPTS )
125
132
                        {
126
 
                                zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores. [too many attempts]");
 
133
                                zabbix_log(LOG_LEVEL_CRIT, "Can't recreate ZABBIX semaphores for IPC key 0x%lx. [too many attempts]",
 
134
                                        sem_key);
127
135
                                exit(1);
128
136
                        }
129
137
                        if ( attempts > (ZBX_MAX_ATTEMPTS / 2) )
140
148
                {
141
149
                        if( -1 == semctl(ZBX_SEM_LIST_ID, 0, IPC_STAT, semopts))
142
150
                        {
143
 
                                zbx_error("Semaphore [%i] error in semctl(IPC_STAT)", name);
 
151
                                zbx_error("Semaphore [%i] error in semctl(IPC_STAT). %s.",
 
152
                                        name,
 
153
                                        strerror(errno));
144
154
                                break;
145
155
                        }
146
156
                        if(semopts.buf->sem_otime !=0 ) goto lbl_return;