[mercury-users] rotd-2007-02-10 won't compile on Ubuntu

Michael Day mikeday at yeslogic.com
Wed Feb 14 19:46:39 AEDT 2007


Hi Julien,

> We've noticed this problem with Debian testing but only when you build
> Mercury under nohup.  Are you using nohup?

This problem affects every Mercury program running when stdin or stdout 
is closed, thanks to mercury_init_io:

     MR_file(mercury_stdin_binary) = fdopen(dup(fileno(stdin)), ""rb"");
     if (MR_file(mercury_stdin_binary) == NULL) {
         MR_fatal_error(""error opening standard input stream in ""
             ""binary mode:\\n\\tfdopen() failed: %s"",
             strerror(errno));
     }
     MR_file(mercury_stdout_binary) = fdopen(dup(fileno(stdout)), ""wb"");
     if (MR_file(mercury_stdout_binary) == NULL) {
         MR_fatal_error(""error opening standard output stream in ""
             ""binary mode:\\n\\tfdopen() failed: %s"",
             strerror(errno));
     }

The fatal error is even more annoying for programs that don't actually 
*use* stdin or stdout in binary mode; it seems like it would be better 
if Mercury handled this more gracefully.

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list