- diff --git a/basic/test8.c b/basic/test8.c
- index d65eb3a..f993631 100644
- --- a/basic/test8.c
- +++ b/basic/test8.c
- @@ -43,7 +43,7 @@ static int Tflag = 0; /* print timing */
- static int Fflag = 0; /* test function only; set count to 1, negate -t */
- static int Nflag = 0; /* Suppress directory operations */
- -#define SNAME "/this/is/a/symlink" /* symlink prefix */
- +#define SNAME "/dev/this/is/a/symlink" /* symlink prefix */
- static void
- usage()
- diff --git a/lock/runtests b/lock/runtests
- index 21b09a5..4db16e2 100755
- --- a/lock/runtests
- +++ b/lock/runtests
- @@ -64,7 +64,7 @@ do
- ;;
- esac
- echo ""
- - $i $TESTARGS $NFSTESTDIR
- + ./$i $TESTARGS $NFSTESTDIR
- done
- echo "Congratulations, you passed the locking tests!"
- diff --git a/special/Makefile b/special/Makefile
- index 77215c1..4377925 100644
- --- a/special/Makefile
- +++ b/special/Makefile
- @@ -3,7 +3,7 @@
- # 1.4 Lachman ONC Test Suite source
- #
- -TESTS=op_unlk op_ren op_chmod dupreq excltest negseek rename holey \
- +TESTS=op_unlk op_chmod dupreq excltest negseek rename holey \
- truncate nfsidem nstat stat stat2 touchn fstat rewind \
- telldir bigfile bigfile2 freesp
- DOSRUNFILES = scripts/*.bat
- diff --git a/special/freesp.c b/special/freesp.c
- index 1affa4a..9d5491a 100644
- --- a/special/freesp.c
- +++ b/special/freesp.c
- @@ -10,6 +10,10 @@
- * Usage: freesp [filename]
- */
- +#if defined(__CYGWIN__)
- +#define _GNU_SOURCE 1
- +#endif
- +
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
- @@ -38,8 +42,7 @@ static char *filename = "freesp.dat";
- static void verify_size ARGS_((int, off_t));
- -#ifndef F_FREESP
- -
- +#if !defined(F_FREESP) && !defined(FALLOC_FL_PUNCH_HOLE)
- /*ARGUSED*/
- int
- main(argc, argv)
- @@ -49,8 +52,25 @@ main(argc, argv)
- printf("fcntl(...F_FREESP...) not available on this platform.\n");
- exit(0);
- }
- +#else
- +#if defined(F_FREESP)
- +int fcntl_freesp(int fd, flock_t *freesp)
- +{
- + return fcntl(fd, F_FREESP, &clear);
- +}
- +
- +#elif defined(FALLOC_FL_PUNCH_HOLE)
- +typedef struct flock flock_t;
- +
- +int fcntl_freesp(int fd, flock_t *freesp)
- +{
- + return fallocate(fd,
- + FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
- + freesp->l_start,
- + freesp->l_len);
- +}
- +#endif
- -#else /* F_FREESP */
- int
- main(argc, argv)
- @@ -103,8 +123,8 @@ main(argc, argv)
- }
- clear.l_start = 0;
- clear.l_whence = SEEK_SET;
- - clear.l_len = 0; /* entire file */
- - if (fcntl(fd, F_FREESP, &clear) < 0) {
- + clear.l_len = NUMBUFS * BUFSIZE; /* entire file */
- + if (fcntl_freesp(fd, &clear) < 0) {
- fprintf(stderr, "can't clear %s: %s\n",
- filename, strerror(errno));
- exit(1);
- diff --git a/special/runtests.wrk b/special/runtests.wrk
- index 8f099fa..385ac61 100644
- --- a/special/runtests.wrk
- +++ b/special/runtests.wrk
- @@ -29,7 +29,7 @@ if [ "$CIFS" = "yes" ] && echo $MNTOPTIONS | grep -E "vers=2|vers=3" > /dev/null
- then
- echo "skipping test; not supported by SMB 2.0 and higher versions"
- else
- - TMPDIR= ./op_ren
- + : # TMPDIR= ./op_ren
- fi
- echo ""
- diff --git a/tests.init b/tests.init
- index 27e1a47..83670f2 100644
- --- a/tests.init
- +++ b/tests.init
- @@ -3,7 +3,7 @@
- #
- MNTOPTIONS="rw,hard,intr"
- # Dummy MNTPOINT definition; should get overriden by server script.
- -MNTPOINT="/mnt/nfs"
- +MNTPOINT="/mnt/Windows_NT"
- SERVER=""
- SERVPATH="/server"
- @@ -11,37 +11,11 @@ TEST="-a"
- TESTARG="-t"
- # set MOUNTCMD and UMOUNTCMD
- -# Use this mount command if using:
- -# BSD
- -# SunOS 4.X
- -# Tru64 UNIX
- -# HPUX
- -# Linux
- -# AIX
- -# Mac OS X
- -# At least some BSD systems don't recognize "hard" (since that's the
- -# default), so you might also want to use this definition of MNTOPTIONS.
- -MNTOPTIONS="rw,intr"
- -MOUNTCMD='./domount -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
- UMOUNTCMD='./domount -u $MNTPOINT'
- # set DASHN and BLC
- -# Use the next two lines if using:
- -# BSD
- -# SunOS 4.X
- -# Linux
- -# Tru64 UNIX
- -# Mac OS X
- -DASHN=-n
- -BLC=
- # set PATH
- -# Use this path for:
- -# Tru64 UNIX
- -# SVR4
- -# Linux
- -PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:.
- -
- # -----------------------------------------------
- # Defines for various variables used in scripts and makefiles.
- #
- @@ -52,26 +26,3 @@ CC=cc
- CFLAGS=
- LIBS=
- LOCKTESTS=tlock
- -MOUNT=/bin/mount
- -UMOUNT=/bin/umount
- -LOCKTESTS=`echo tlocklfs tlock64`
- -
- -# Use with Linux if your distro doesn't provide a "cc".
- -CC=gcc
- -
- -# Use with Linux 2.2 / GNU libc 2.0
- -#CFLAGS=`echo -DLINUX -DGLIBC=20 -DMMAP -DSTDARG -fwritable-strings`
- -#LIBS=`echo -lnsl`
- -
- -# Use with Linux 2.4 / GNU libc 2.2
- -#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
- -#LIBS=`echo -lnsl`
- -
- -# Use with Linux 2.6 / gcc 4.0
- -CFLAGS=`echo -DLINUX -DHAVE_SOCKLEN_T -DGLIBC=22 -DMMAP -DSTDARG`
- -LIBS=`echo -lnsl`
- -
- -# Use with Linux glibc > 2.26
- -CFLAGS=`echo -DLINUX -DHAVE_SOCKLEN_T -DGLIBC=22 -DMMAP -DSTDARG`
- -CFLAGS+=`pkg-config --cflags libtirpc`
- -LIBS=`pkg-config --libs libtirpc`
- diff --git a/tools/Makefile b/tools/Makefile
- index ce2cbc7..8cc1903 100644
- --- a/tools/Makefile
- +++ b/tools/Makefile
- @@ -8,7 +8,7 @@
- # 'make copy DESTDIR=path' copies test programs to path
- # 'make dist DESTDIR=path' copies sources to path
- -TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
- +TESTS = tcp tcpd udp udpd dirdmp dirprt
- # dirdmp apparently doesn't work with Linux 2.2. So for Linux systems,
- # comment out the above definition and use this one.
- diff --git a/tools/dirdmp.c b/tools/dirdmp.c
- index 6b231a0..e8dcca3 100644
- --- a/tools/dirdmp.c
- +++ b/tools/dirdmp.c
- @@ -7,8 +7,8 @@
- #include <sys/param.h>
- #include <sys/types.h>
- -#include <dirent.h>
- #include <sys/stat.h>
- +#include <dirent.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
- @@ -38,7 +38,7 @@ main(argc, argv)
- int argc;
- char *argv[];
- {
- -#if defined(LINUX) || defined (AIX)
- +#if defined(LINUX) || defined(__CYGWIN__) || defined (AIX)
- fprintf(stderr, "dirdmp is not supported on this platform.\n");
- exit(1);
- #else
- @@ -50,7 +50,7 @@ main(argc, argv)
- #endif /* LINUX || AIX */
- }
- -#if !(defined(LINUX) || defined(AIX))
- +#if !(defined(LINUX) || defined(__CYGWIN__) || defined(AIX))
- static void
- print(dir)
- diff --git a/tools/dirprt.c b/tools/dirprt.c
- index a0630eb..acb9ec3 100644
- --- a/tools/dirprt.c
- +++ b/tools/dirprt.c
- @@ -72,7 +72,7 @@ print(dir)
- return;
- }
- while ((dp = readdir(dirp)) != NULL) {
- -#if defined(SVR3) || defined(SVR4) || defined(LINUX)
- +#if defined(SVR3) || defined(SVR4) || defined(LINUX) || defined(__CYGWIN__)
- printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
- (long)dp->d_ino,
- dp->d_reclen, dp->d_name);
cthon04 cygwin patch
Posted by Anonymous on Mon 17th Feb 2025 10:09
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.