summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsf <sf@13f79535-47bb-0310-9956-ffa450edef68>2012-05-06 18:06:43 +0000
committersf <sf@13f79535-47bb-0310-9956-ffa450edef68>2012-05-06 18:06:43 +0000
commit0ec60a8a5870fb7760c7ac2982954b590f950590 (patch)
treea0124309fbf67bba28647c7e9233362846174d48
parent696047093a985293e6c92162e993b7804551e74a (diff)
downloadlibapr-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--CHANGES3
-rw-r--r--file_io/unix/seek.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index bb1910774..99bcab4bb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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;