Changeset 945 for trunk/zoo-project/zoo-kernel/service_internal.c
- Timestamp:
- Aug 14, 2019, 4:30:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r921 r945 198 198 int res=-1; 199 199 if(s!=NULL){ 200 int fcntlRes; 200 201 s->lock.l_type = F_UNLCK; 201 202 res=fcntl(fileno(s->lockfile), F_SETLK, &s->lock); 202 203 if(res==-1) 203 204 return res; 204 fclose(s->lockfile);205 205 #ifndef WIN32 206 206 // Check if there is any process locking a file and delete the lock if not. 207 207 s->lock.l_type = F_WRLCK; 208 if(fcntl(fileno(s->lockfile), F_GETLK, &s->lock)!=-1 && s->lock.l_type == F_UNLCK){ 209 #endif 208 fcntlRes=fcntl(fileno(s->lockfile), F_GETLK, &s->lock); 209 if(fcntlRes!=1 && s->lock.l_type == F_UNLCK){ 210 #endif 211 fclose(s->lockfile); 210 212 zUnlink(s->filename); 211 213 #ifndef WIN32
Note: See TracChangeset
for help on using the changeset viewer.