Hi everybody.

As I wrote it last summer, I can probably help you a little with the
makefilelib.

Generally it seams that the problem with echo and write() occurs when
executing the makefile with make, not during its creation with the
makefilelib.

On Fr, 2011-01-21 at 13:06 +0100, Rogier Wolff wrote:

> The error is explained in the write system call manual page: 
> 
>        EBADF  fd is not a valid file descriptor or is not open for writing.
> 
> So standard output apparently isn't connected anywhere. (but as the
> error message DOES come through, the stderr IS!!!)

The three standard file descriptors are inherited from the parent so
they don't need to be set explicitly. So maybe it's done nowhere.

> > o Open a shell, change to the project directory, and use
> >   "make -f <projectname>.pto.mk"
> >   to start the stitching
> 

Does it work directly on a shell?

> It seems to be: 
> 
>       src/hugin_base/makefilelib/test_util.cpp
> 
> (which is unlogical because it isn't in any test-code anymore, and I
> think this is the actual code used, because I can't find any other
> pipe calls.
> Anyway, on first inspection I'd say that the code looks good. On 
> the other hand, code like: 
> 
> 
>      if(dup2(fdmakein[0], 0) == -1 || dup2(fdmakeout[1], 1) == -1 || 
> dup2(fdmakeerr[1], 2) == -1) {
>         std::cerr << "Failed to switch std stream" << std::endl;
>         exit(-1);
>      }
This was for development testing only and isn't built unless you
explicitly enable it with a cmake flags, and then isn't run unless you
start one of the dev-testers.
It connects the forked make process to the streams of the tester to
speed up the test, bypassing the creation of a makefile. 
There is no connection to the problem you discuss here.
> 
> should be rewritten as: 
> 
>    stdinfd = dup2 (fdmakein[0], 0);
>    if (stdinfd != 0) {
>       //  can't dup2 stdinfd... 
>    }
>    ... 
The line above normally never fails .. so no need.


-- 
Flo

-- 
You received this message because you are subscribed to the Google Groups 
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to