LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-30-2003, 08:41 AM   #1
GŠutama
Member
 
Registered: Jun 2003
Location: Tokyo
Distribution: Gentoo
Posts: 78

Rep: Reputation: 15
Cant get tbl to exit when used as filter (in C)


I am writing a program that will format documents a special way. I do this by piping the file via first 'tbl' and then 'eqn'.

However I cant get 'tbl' to exit (with any exitcode) so my program just stops at the waitpid command, I do want to check that 'tbl' exited OK before proceding.

The basic outline of the program is:

setup pipe for "cat -> tbl"
fork of "cat"
fork of "tbl"
setup pipe for "tbl -> eqn"
fork of "eqn"

wait for all the forked processes to finish.

In each fork I close the pipes after changing stdout and stdin.

the "cat" process finishes nicely but not "tbl"

Does "tbl" need a EOF and if so how do I insert it after "cat"?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between exit 1 and exit kushalkoolwal Programming 6 10-20-2005 04:56 PM
Spam filter to external mail filter deadlock Linux - Software 1 06-16-2004 03:28 AM
L7 Filter Xing Linux - Software 0 09-17-2003 05:56 AM
filter.pl where? jfisk Linux - Software 5 09-04-2003 03:35 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration