diff options
author | Yang Tse <yangsita@gmail.com> | 2009-11-26 10:15:08 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-11-26 10:15:08 +0000 |
commit | cbd527843b4d0d04e33bb57d99c8e6139100db80 (patch) | |
tree | 5ac6f83ea3b59f6d280eb9d8024bafed5585745e /tests/server/util.c | |
parent | fba233bb34d768f41e8ff35af54ba637f61eef2b (diff) | |
download | curl-cbd527843b4d0d04e33bb57d99c8e6139100db80.tar.gz |
Only attempt to clear the server-logs lock when previously set by this same server.
Diffstat (limited to 'tests/server/util.c')
-rw-r--r-- | tests/server/util.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/server/util.c b/tests/server/util.c index 646e52bcf..6c5022406 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -260,6 +260,12 @@ void clear_advisor_read_lock(const char *filename) int error = 0; int res; + /* + ** Log all removal failures. Even those due to file not existing. + ** This allows to detect if unexpectedly the file has already been + ** removed by a process different than the one that should do this. + */ + do { res = unlink(filename); } while(res && ((error = ERRNO) == EINTR)); |