From: Enlightenment S. <no-...@en...> - 2009-01-24 22:29:22
|
Log: * src/lib/evil_fcntl.c: fix fcntl() Author: caro Date: 2009-01-24 14:29:19 -0800 (Sat, 24 Jan 2009) New Revision: 38766 Modified: trunk/PROTO/evil/ChangeLog trunk/PROTO/evil/src/lib/evil_fcntl.c Modified: trunk/PROTO/evil/ChangeLog =================================================================== --- trunk/PROTO/evil/ChangeLog 2009-01-24 22:26:21 UTC (rev 38765) +++ trunk/PROTO/evil/ChangeLog 2009-01-24 22:29:19 UTC (rev 38766) @@ -1,3 +1,8 @@ +2009-01-24 Vincent Torri <doursse at users dot sf dot net> + + * src/lib/evil_fcntl.c: + fix fcntl() + 2009-01-19 Vincent Torri <doursse at users dot sf dot net> * src/bin/Makefile.am: Modified: trunk/PROTO/evil/src/lib/evil_fcntl.c =================================================================== --- trunk/PROTO/evil/src/lib/evil_fcntl.c 2009-01-24 22:26:21 UTC (rev 38765) +++ trunk/PROTO/evil/src/lib/evil_fcntl.c 2009-01-24 22:29:19 UTC (rev 38766) @@ -56,34 +56,37 @@ #if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) ) else if ((cmd == F_SETLK) || (cmd == F_SETLKW)) { - struct flock fl; + struct flock *fl; off_t length = 0; long pos; - fl = va_arg(va, struct flock); + fl = va_arg(va, struct flock *); - if (fl.l_len == 0) + if (fl->l_len == 0) { length = _lseek(fd, 0L, SEEK_END); if (length != -1L) res = 0; } - fl.l_len = length - fl.l_start - 1; + fl->l_len = length - fl->l_start - 1; - pos = _lseek(fd, fl.l_start, fl.l_whence); + pos = _lseek(fd, fl->l_start, fl->l_whence); if (pos != -1L) res = 0; - if ((fl.l_type == F_RDLCK) || (fl.l_type == F_WRLCK)) + printf ("Evil 1 %d %d %d\n", fl->l_type, F_RDLCK, F_WRLCK); + if ((fl->l_type == F_RDLCK) || (fl->l_type == F_WRLCK)) { + printf ("Evil 2\n"); if (cmd == F_SETLK) - res = _locking(fd, _LK_NBLCK, fl.l_len); /* if cannot be locked, we return immediatly */ + res = _locking(fd, _LK_NBLCK, fl->l_len); /* if cannot be locked, we return immediatly */ else /* F_SETLKW */ - res = _locking(fd, _LK_LOCK, fl.l_len); /* otherwise, we try several times */ + res = _locking(fd, _LK_LOCK, fl->l_len); /* otherwise, we try several times */ } - if (fl.l_type == F_UNLCK) - res = _locking(fd, _LK_UNLCK, fl.l_len); + printf ("Evil 3\n"); + if (fl->l_type == F_UNLCK) + res = _locking(fd, _LK_UNLCK, fl->l_len); } #endif /* __CEGCC__ || __MINGW32CE__ */ |