Changeset 1139 for trunk


Ignore:
Timestamp:
04/02/09 16:45:12 (3 years ago)
Author:
alonbl
Message:

Fix openst status lock

By Stanislav Brabec.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ct/status.c

    r1047 r1139  
    210210{ 
    211211        int fd, retries = 10; 
     212        int ret = -1; 
    212213        char status_lock_path[PATH_MAX]; 
    213214        char status_temp_path[PATH_MAX]; 
     
    225226        while (retries--) { 
    226227                if (link(status_temp_path, status_lock_path) >= 0) { 
    227                         close(fd); 
    228                         unlink(status_lock_path); 
    229                         return 0; 
     228                        ret = 0; 
     229                        break; 
    230230                } 
    231231        } 
    232232 
    233233        close(fd); 
    234         unlink(status_lock_path); 
    235         return -1; 
     234        unlink(status_temp_path); 
     235        return ret; 
    236236} 
    237237 
Note: See TracChangeset for help on using the changeset viewer.