Subject: ftruncate() difficulties on Amiga
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Andy Heffernan <ahh@netcom.com>
List: current-users
Date: 04/27/1994 21:45:25
Hello,
Is there a typecast missing in sys/ufs/ufs_vnops.c?
*** sys/ufs/ufs_vnops.c-orig Mon Apr 25 03:29:15 1994
--- sys/ufs/ufs_vnops.c Wed Apr 27 21:19:06 1994
***************
*** 275,281 ****
if (vap->va_size != VNOVAL) {
if (vp->v_type == VDIR)
return (EISDIR);
! if (error = itrunc(ip, vap->va_size, 0)) /* XXX IO_SYNC? */
return (error);
}
if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) {
--- 275,281 ----
if (vap->va_size != VNOVAL) {
if (vp->v_type == VDIR)
return (EISDIR);
! if (error = itrunc(ip, (u_long)vap->va_size, 0)) /* XXX IO_SYNC? */
return (error);
}
if (vap->va_atime.ts_sec != VNOVAL || vap->va_mtime.ts_sec != VNOVAL) {
The lack of this typecast causes ftruncate() to not work correctly on
the Amiga, causing programs like strip and ar to create 0-length files.
Thanks.
------------------------------------------------------------------------------