OS X patch for run_erl.c

Bengt Kleberg <>
Mon Sep 15 10:07:01 CEST 2003


Sean Hinde wrote:
> Hi,
> 
> The following patch to run_erl.c is required for Erlang to run in 
> embedded mode under OS X. Without this patch run_erl fails to create the 

...deleted
> +#ifdef HAVE_MACH_O_DYLD_H
> +  if ((mkfifo(name, perm) < 0) && (errno != EEXIST))
> +#else
> +    if ((mknod(name, S_IFIFO | perm, 0) < 0) && (errno != EEXIST))
> +#endif

perhaps mkfifo() is deprecated (or something even worse :-), but would 
it not have been better to test like this:

#ifdef HAVE_MKFIFO
	if ((mkfifo(name, perm) < 0) && (errno != EEXIST))
#else
	if ((mknod(name, S_IFIFO | perm, 0) < 0) && (errno != EEXIST))
#endif


bengt, who really thinks #ifdef should only be used in libraries, not in 
''real'' code.




More information about the erlang-questions mailing list