git://scientific.zcu.cz
/
jra1mw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2ce8ee
)
Return timeout error instead of writing to unlocked event file
author
Zdeněk Salvet
<salvet@ics.muni.cz>
Wed, 15 Feb 2006 13:34:59 +0000
(13:34 +0000)
committer
Zdeněk Salvet
<salvet@ics.muni.cz>
Wed, 15 Feb 2006 13:34:59 +0000
(13:34 +0000)
if all lock attempts failed. Don't sleep after last lock attempt.
org.glite.lb.common/src/log_msg.c
patch
|
blob
|
blame
|
history
diff --git
a/org.glite.lb.common/src/log_msg.c
b/org.glite.lb.common/src/log_msg.c
index
eaf5d2f
..
595ed19
100644
(file)
--- a/
org.glite.lb.common/src/log_msg.c
+++ b/
org.glite.lb.common/src/log_msg.c
@@
-143,7
+143,7
@@
int edg_wll_log_event_write(
case EAGAIN:
case EACCES:
case EINTR:
- sleep(fcntl_timeout);
+
if ((i+1) < fcntl_attempts)
sleep(fcntl_timeout);
break;
default:
edg_wll_SetError(ctx, errno, "fcntl()");
@@
-151,6
+151,10
@@
int edg_wll_log_event_write(
}
} else break;
}
+ if (i == fcntl_attempts) {
+ edg_wll_SetError(ctx, ETIMEDOUT, "timed out trying to lock event file");
+ goto cleanup;
+ }
if ( fseek(outfile, 0, SEEK_END) == -1 ) {
edg_wll_SetError(ctx, errno, "fseek()");