Serge E. Hallyn [EMAIL PROTECTED] wrote:

<snip>
| > +
| > +   rc = read(fifo_fd, &c, 1);
| > +   if (rc != -1 && errno != EAGAIN) {
| 
|       Won't errno only be set if rc == -1?  Did you mean || here?

Yes I meant ||. I also had 'errno = 0' before the read, but seem
to have deleted it when I moved code around.

<snip>

| > +           } else if (S_ISFIFO(fdinfo->mode)) {
| > +                   int pipefds[2] = { 0, 0 };
| > +
| > +                   /*
| > +                    * We create the pipe when we see the pipe's read-fd.
| > +                    * Just ignore the pipe's write-fd.
| > +                    */
| > +                   if (fdinfo->flag == O_WRONLY)
| > +                           continue;
| > +
| > +                   DEBUG("Creating pipe for fd %d\n", fdinfo->fdnum);
| > +
| > +                   t_d(PT_PIPE(pid, pipefds));
| > +                   t_d(pipefds[0]);
| > +                   t_d(pipefds[1]);
| > +
| > +                   if (pipefds[0] != fdinfo->fdnum) {
| > +                           DEBUG("Hmm, new pipe has fds %d, %d "
| > +                                   "Old pipe had fd %d\n", pipefds[0],
| > +                                   pipefds[1], fdinfo->fdnum); getchar();
| 
| Can you explain what you're doing here?  I would have expected you to
| dup2() to get back the correct fd, so maybe I'm missing something...

You are right, I should use dup2() here.

Will send an updated patch.

Thanks,

Suka
_______________________________________________
Containers mailing list
[EMAIL PROTECTED]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
Devel@openvz.org
https://openvz.org/mailman/listinfo/devel

Reply via email to