[Ecls-list] open-pipe failing on FreeBSD
Juan Jose Garcia-Ripoll
worm at arrakis.es
Thu Jul 3 06:03:11 UTC 2003
On Wednesday 02 July 2003 18:04, Julian St. wrote:
> Hello,
>
> I noticed that every call to si:open-pipe returns NIL, so I looked into the
> following piece of code (unixsys.d):
> -> if ((ptr = popen(cmd->string.self, OPEN_R)) == NULL) <-
> @(return Cnil)
> [...]
> The problem is the type OPEN_R which is "rb". That seems to cause trouble,
> as every call to popen fails, unless one substitutes OPEN_R with "r"
> dropping the "b". The popen man page does not mention a "b" as type flag.
Your patch is correct and I will apply it today. "rb" should not be used with
popen(), because popen() is not ANSI compatible and the "b" flag is not
recognized (and may cause problems in some platforms).
However, I do not want to change the definitions of OPEN_R. The current values
have been very useful when porting ECL to other platforms (For instance in
Cygwin, and MacOSX at the very beginning), and should be recognized by any
POSIX-compliant platform. In other words, the least platform-dependent
#ifdefs, the better :-)
Juanjo
More information about the ecl-devel
mailing list