summaryrefslogtreecommitdiffstats
path: root/source/lib/replace.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-06-21 03:51:54 +0000
committerGerald Carter <jerry@samba.org>2005-06-21 03:51:54 +0000
commitd8568a71b16173f22bd894d18dfc5c4a23650904 (patch)
treec3ca0b3ae8d2ac8d88bdab1150ed76626e43cfd4 /source/lib/replace.c
parentc2d4b6133d071152272fccec0f015c7edd175074 (diff)
downloadsamba-d8568a71b16173f22bd894d18dfc5c4a23650904.tar.gz
samba-d8568a71b16173f22bd894d18dfc5c4a23650904.tar.xz
samba-d8568a71b16173f22bd894d18dfc5c4a23650904.zip
r7791: sync with SAMBA_3_0 branch as of r7789. Geting ready for 3.0.20pre1
Diffstat (limited to 'source/lib/replace.c')
-rw-r--r--source/lib/replace.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/lib/replace.c b/source/lib/replace.c
index 298707727e9..b7695bd8dd0 100644
--- a/source/lib/replace.c
+++ b/source/lib/replace.c
@@ -29,17 +29,20 @@ ftruncate for operating systems that don't have it
********************************************************************/
int ftruncate(int f,SMB_OFF_T l)
{
- struct flock fl;
-
- fl.l_whence = 0;
- fl.l_len = 0;
- fl.l_start = l;
- fl.l_type = F_WRLCK;
- return fcntl(f, F_FREESP, &fl);
+#ifdef HAVE_CHSIZE
+ return chsize(f,l);
+#else
+ struct flock fl;
+
+ fl.l_whence = 0;
+ fl.l_len = 0;
+ fl.l_start = l;
+ fl.l_type = F_WRLCK;
+ return fcntl(f, F_FREESP, &fl);
+#endif
}
#endif /* HAVE_FTRUNCATE */
-
#ifndef HAVE_STRLCPY
/* like strncpy but does not 0 fill the buffer and always null
terminates. bufsize is the size of the destination buffer */