zsh-workers
 help / color / mirror / code / Atom feed
* zftp module problem
@ 1999-04-30 10:12 Bart Schaefer
  1999-04-30 11:16 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1999-04-30 10:12 UTC (permalink / raw)
  To: zsh-workers

I'm just rebuilding a dynamic zsh 3.1.5-pws-XX for the first time in quite
a while, and I just ran into a compilation problem with zftp.c:

../../../zsh-3.1.5/Src/Modules/zftp.c: In function `zftp_test':
../../../zsh-3.1.5/Src/Modules/zftp.c:2071: storage size of `pfd' isn't known
../../../zsh-3.1.5/Src/Modules/zftp.c:2086: `POLLNORM' undeclared (first use this function)

My system (Linux, RedHat 4.2, libc5, yes I know it's old) HAS_POLL and
HAS_SELECT but does not have struct pollfd, POLLIN, or POLLNORM defined.

The following is a rather brute-force correction.

Index: Src/Modules/zftp.c
===================================================================
diff -u -r1.5 zftp.c
--- zftp.c	1999/03/29 21:46:03	1.5
+++ zftp.c	1999/04/30 10:08:54
@@ -2067,7 +2067,7 @@
 {
 #if defined(HAVE_POLL) || defined(HAVE_SELECT)
     int ret;
-# ifdef HAVE_POLL
+# if defined(HAVE_POLL) && (defined(POLLIN) || defined(POLLNORM))
     struct pollfd pfd;
 # else
     fd_set f;
@@ -2077,7 +2077,7 @@
     if (zcfd == -1)
 	return 1;
 
-# ifdef HAVE_POLL
+# if defined(HAVE_POLL) && (defined(POLLIN) || defined(POLLNORM))
 #  ifndef POLLIN
     /* safety first, though I think POLLIN is more common */
 #   define POLLIN POLLNORM

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zftp module problem
  1999-04-30 10:12 zftp module problem Bart Schaefer
@ 1999-04-30 11:16 ` Peter Stephenson
  1999-04-30 17:18   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 1999-04-30 11:16 UTC (permalink / raw)
  To: zsh-workers

"Bart Schaefer" wrote:
> My system (Linux, RedHat 4.2, libc5, yes I know it's old) HAS_POLL and
> HAS_SELECT but does not have struct pollfd, POLLIN, or POLLNORM defined.

Any objection to doing it this way?  It means that the HAVE_SELECT test
works properly (i.e. if some of the poll() stuff is missing and select() is
not present it won't use either).

--- Src/Modules/zftp.c.orig	Wed Mar 24 10:20:02 1999
+++ Src/Modules/zftp.c	Fri Apr 30 13:12:39 1999
@@ -71,6 +71,9 @@
 #ifdef HAVE_POLL_H
 # include <poll.h>
 #endif
+#if defined(HAVE_POLL) && !defined(POLLIN) && !defined(POLLNORM)
+# undef HAVE_POLL
+#endif
 
 /* pinch the definition from <netinet/in.h> for deficient headers */
 #ifndef INADDR_NONE

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: zftp module problem
  1999-04-30 11:16 ` Peter Stephenson
@ 1999-04-30 17:18   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1999-04-30 17:18 UTC (permalink / raw)
  To: zsh-workers

On Apr 30,  1:16pm, Peter Stephenson wrote:
} Subject: Re: zftp module problem
}
} "Bart Schaefer" wrote:
} > My system (Linux, RedHat 4.2, libc5, yes I know it's old) HAS_POLL and
} > HAS_SELECT but does not have struct pollfd, POLLIN, or POLLNORM defined.
} 
} Any objection to doing it this way?

No objection whatsoever.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-04-30 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-30 10:12 zftp module problem Bart Schaefer
1999-04-30 11:16 ` Peter Stephenson
1999-04-30 17:18   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).