Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

fifo configure check



I discovered that fifo test fails if zsh is compiled in an NFS mounted
directory.  The patch below shoud fix it (it's only for configure.in, you
need autoconf).  I did not test it but it should work.

Zoltan


*** configure.in	1996/12/05 03:59:45	3.1.0.10
--- configure.in	1996/12/13 02:27:32
***************
*** 656,680 ****
  {
      char c;
      int fd;
!     int pid;
!     unlink("conftestfifo");
  #ifdef HAVE_MKFIFO
!     if(mkfifo("conftestfifo", 0600) < 0)
  #else
!     if(mknod("conftestfifo", 0010600, 0) < 0)
  #endif
  	exit(1);
      pid = fork();
      if(pid < 0)
  	exit(1);
      if(pid) {
! 	fd = open("conftestfifo", O_RDONLY);
  	exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
      }
!     fd = open("conftestfifo", O_WRONLY);
!     if(fd < 0 || write(fd, "x", 1) < 1)
! 	kill(getppid(), SIGTERM);
!     exit(0);
  }
  ],
    zsh_cv_sys_fifo=yes,
--- 656,680 ----
  {
      char c;
      int fd;
!     int pid, ret;
!     unlink("/tmp/conftestfifo");
  #ifdef HAVE_MKFIFO
!     if(mkfifo("/tmp/conftestfifo", 0600) < 0)
  #else
!     if(mknod("/tmp/conftestfifo", 0010600, 0) < 0)
  #endif
  	exit(1);
      pid = fork();
      if(pid < 0)
  	exit(1);
      if(pid) {
! 	fd = open("/tmp/conftestfifo", O_RDONLY);
  	exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
      }
!     fd = open("/tmp/conftestfifo", O_WRONLY);
!     ret = (fd < 0 || write(fd, "x", 1) < 1);
!     unlink("/tmp/conftestfifo");
!     exit(ret);
  }
  ],
    zsh_cv_sys_fifo=yes,



Messages sorted by: Reverse Date, Date, Thread, Author