summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/replace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/replace.c b/source4/lib/replace.c
index ca367da9b5..89612912b7 100644
--- a/source4/lib/replace.c
+++ b/source4/lib/replace.c
@@ -32,6 +32,9 @@ ftruncate for operating systems that don't have it
********************************************************************/
int ftruncate(int f,off_t l)
{
+#ifdef HAVE_CHSIZE
+ return chsize(f,l);
+#else
struct flock fl;
fl.l_whence = 0;
@@ -39,6 +42,7 @@ ftruncate for operating systems that don't have it
fl.l_start = l;
fl.l_type = F_WRLCK;
return fcntl(f, F_FREESP, &fl);
+#endif
}
#endif /* HAVE_FTRUNCATE */