Avoid a dup2(2) in apply_filter() - start_command() can do it for us.
commit7683b6e81fa0f1f55d4974d69fb87c7c7b6b394e
authorJohannes Sixt <johannes.sixt@telecom.at>
Fri, 19 Oct 2007 19:48:05 +0000 (19 21:48 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 21 Oct 2007 05:30:42 +0000 (21 01:30 -0400)
tree84ad5197c3affed0a06bb51c3dd1ae115bbde0ca
parenta0ae35ae2d92cc706f902227cb0f34e2a2f0fd50
Avoid a dup2(2) in apply_filter() - start_command() can do it for us.

When apply_filter() runs the external (clean or smudge) filter program, it
needs to pass the writable end of a pipe as its stdout. For this purpose,
it used to dup2(2) the file descriptor explicitly to stdout. Now we use
the facilities of start_command() to do it for us.

Furthermore, the path argument of a subordinate function, filter_buffer(),
was not used, so here we replace it to pass the fd instead.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
convert.c