diff options
author | Gerald Carter <jerry@samba.org> | 2005-06-21 03:51:54 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2005-06-21 03:51:54 +0000 |
commit | d8568a71b16173f22bd894d18dfc5c4a23650904 (patch) | |
tree | c3ca0b3ae8d2ac8d88bdab1150ed76626e43cfd4 /source/lib/replace.c | |
parent | c2d4b6133d071152272fccec0f015c7edd175074 (diff) | |
download | samba-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.c | 19 |
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 */ |