Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > pclose failing

pclose failing
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 2006
Status: Offline
Reply With Quote
Nov 30, 2006, 05:39 AM
 
Hi all,

In my application i am trying to select some text & then give it to print. for this i am opening a stream using popen & then later closing using pclose.
Now this is working fine in my environment (solaris) but the pclose function is failing at my clients m/c. Even though print is happening (i.e, no problem with the implementation) but still as pclose is failing it will throw an error message.
I have read pclose fails due to some problem with waitpid(). But what is that trouble ?
Also he has captured the truss output ( system calls made by the appln) which are as follows :

29340: time() = 1164271259
29340: time() = 1164271259
29340: llseek(9, 0, SEEK_CUR) = 605
29340: close(9) = 0
29340: time() = 1164271259
29340: unlink("/tmp//45655e9b03dde") = 0
29340: fstat64(1, 0xFFBFA930) = 0
request id is bw-b15rd-185608 (1 file(s))
29340: write(1, " r e q u e s t i d i".., 42) = 42
29340: _exit(0)
29338: waitid(P_PID, 29340, 0xFFBFE5F0, WEXITED|WTRAPPED|WNOWAIT) = 0
29338: getpgid(29340) = 29306
29338: waitid(P_PID, 29340, 0xFFBFE5F0, WEXITED|WTRAPPED) = 0
29338: _exit(0)
29307: Received signal #18, SIGCLD, in waitid() [caught]
29307: siginfo: SIGCLD CLD_EXITED pid=29338 status=0x0000
29307: waitid(P_PID, 29338, 0xFFBFC0B0, WEXITED|WTRAPPED|_WNOCHLD) Err#4 EINTR
29307: sigprocmask(SIG_SETMASK, 0xFFBFBCB4, 0x00000000) = 0
29307: wait() = 29338 [0x0000]
29307: sigprocmask(SIG_SETMASK, 0xFEFEA074, 0xFFBFBA68) = 0
29307: lwp_unpark(1, 1) = 0
29307: setcontext(0xFFBFBA78)
29307: waitid(P_PID, 29338, 0xFFBFC0B0, WEXITED|WTRAPPED|_WNOCHLD) Err#10 ECHILD
29307: uname(0xFFBFB768) = 1
29307: getpid() = 29307 [29306]
29307: write(3, "12\0\0\b\0\0\0 -\0\002 >".., 5420) = 5420
29307: read(3, 0xFFBFBE00, 32) Err#11 EAGAIN
29307: read(3, "02 @ b @13F98DA3\0\0\0 -".., 32) = 32
29307: read(3, 0xFFBFBE00, 32) Err#11 EAGAIN
29307: read(3, "1C : b A\0\0\0 -\0\002 >".., 32) = 32
29307: read(3, "16\0 b b\0C805B3\0C805B3".., 32) = 32



Can some 1 tell me y pclose is returning -1 every time ?

THanks
Nimisha
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:53 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2