Changeset 7e10f7cd6a31e714c883c3b0f528f09b004a2d9f
- Timestamp:
- 11/16/11 06:24:08
(2 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1321424648 -0500
- git-parent:
[d3ed2ae82b2d3ed70d28abd1aa952fb2fe0b9c56]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1321424648 -0500
- Message:
There is a race condition if we crash between the link and the next run.
The link will be in place and we'll get an error on link() with EEXIST.
I believe this is "okay" to continue.
We still need a test as the other code path link() with errno != EEXIST
will still explode.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r9799031 |
r7e10f7c |
|
| 183 | 183 | if(strcmp(path + strlen(path) - 2, ".h")) { |
|---|
| 184 | 184 | snprintf(hfile, sizeof(hfile), "%s.h", path); |
|---|
| 185 | | if(link(path, hfile) < 0) { |
|---|
| 186 | | noitL(noit_error, "cannot link journal: %s\n", strerror(errno)); |
|---|
| | 185 | if(link(path, hfile) < 0 && errno != EEXIST) { |
|---|
| | 186 | noitL(noit_error, "cannot link journal %s: %s\n", path, strerror(errno)); |
|---|
| 187 | 187 | return -1; |
|---|
| 188 | 188 | } |
|---|
| r9799031 |
r7e10f7c |
|
| 1424 | 1424 | if(strcmp(path + strlen(path) - 3, ".pg")) { |
|---|
| 1425 | 1425 | snprintf(pgfile, sizeof(pgfile), "%s.pg", path); |
|---|
| 1426 | | if(link(path, pgfile) < 0) { |
|---|
| 1427 | | noitL(noit_error, "cannot link journal: %s\n", strerror(errno)); |
|---|
| | 1426 | if(link(path, pgfile) < 0 && errno != EEXIST) { |
|---|
| | 1427 | noitL(noit_error, "cannot link journal %s: %s\n", path, strerror(errno)); |
|---|
| 1428 | 1428 | free(ij); |
|---|
| 1429 | 1429 | return -1; |
|---|