diff options
author | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-06 18:06:43 +0000 |
---|---|---|
committer | sf <sf@13f79535-47bb-0310-9956-ffa450edef68> | 2012-05-06 18:06:43 +0000 |
commit | 0ec60a8a5870fb7760c7ac2982954b590f950590 (patch) | |
tree | a0124309fbf67bba28647c7e9233362846174d48 | |
parent | 696047093a985293e6c92162e993b7804551e74a (diff) | |
download | libapr-0ec60a8a5870fb7760c7ac2982954b590f950590.tar.gz |
Merge r1044447 and add CHANGES entry:
apr_file_trunc(): Don't leave the file locked if flushing fails
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x@1334726 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | file_io/unix/seek.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes for APR 1.4.7 + *) Fix file not being unlocked if truncate call on a file fails. + [Mladen Turk] + *) apr_mcast_hops: Fix EINVAL for IPv6 sockets caused by using byte instead integer for setsockopt. [Mladen Turk] diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c index e70805d7f..3f5aa00e9 100644 --- a/file_io/unix/seek.c +++ b/file_io/unix/seek.c @@ -117,10 +117,10 @@ apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset) /* Reset buffer positions for write mode */ fp->bufpos = fp->direction = fp->dataRead = 0; } + file_unlock(fp); if (rc) { return rc; } - file_unlock(fp); } if (ftruncate(fp->filedes, offset) == -1) { return errno; |