OpenVZ Forum


Home » Mailing lists » Devel » [RFC][PATCH][cryo] Save/restore state of unnamed pipes
Re: [RFC][PATCH][cryo] Save/restore state of unnamed pipes [message #31166 is a reply to message #31164] Fri, 20 June 2008 02:48 Go to previous messageGo to previous message
Matt Helsley is currently offline  Matt Helsley
Messages: 86
Registered: August 2006
Member
On Thu, 2008-06-19 at 18:54 -0700, sukadev@us.ibm.com wrote:
> Matt Helsley [matthltc@us.ibm.com] wrote:

<snip>

> | 	if (pipefds[0] != restarted_read_fd) {
> | 	        dup2(pipefds[1], restarted_write_fd);
> | 		close(pipefds[1]);
> | 	}
> 
> Shouldn't the last if be
> 
> 	if (pipefds[1] != restarted_wrte_fd) ?
> 
> (otherwise it would break if pipefds[0] = 11 and pipefds[1] = 200)

Argh, copy-paste error. You are correct.

> I came up with something similar, but with an extra close(). And
> in my code, I had restarted_* names referring to pipefds[] making
> it a bit confusing initially.
> 
> How about using actual_fds[] (instead of pipefds) and expected_fds[]
> instead of (restart_*) ? 

I like actual_fds[] instead of pipefds[] but still prefer the restart_*
names over expected_fds[].

Cheers,
	-Matt

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Fwd: Re: [PATCH] iproute2: add support for IFLA_NET_NS_PID in ip link v2]
Next Topic: [PATCH 0/4][cryo] Test pipes
Goto Forum:
  


Current Time: Fri Aug 16 06:36:31 GMT 2024

Total time taken to generate the page: 0.03823 seconds