An error occurs in the open part of the c code used by Android [closed]










-2















I am calling the function from C code.



FILE *temp;
char command = "dumpsys SurfaceFlinger --latency SurfaceView";
strcat(command,"" );
temp = popen(command, "r");


I call this once a second. But in about five minutes the process will be over. I checked the log and found that there was a problem in the open. But we don't know what caused it.










share|improve this question













closed as off-topic by Vega, sideshowbarker, jww, Madhur Bhaiya, Makyen Nov 26 '18 at 11:37


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Vega, sideshowbarker, Makyen
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3





    Do you ever close it?

    – Osiris
    Nov 16 '18 at 6:30






  • 3





    What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

    – Osiris
    Nov 16 '18 at 6:32












  • I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

    – DOBY
    Nov 16 '18 at 6:39







  • 3





    Are you closing it every time before calling it again?

    – Osiris
    Nov 16 '18 at 6:40















-2















I am calling the function from C code.



FILE *temp;
char command = "dumpsys SurfaceFlinger --latency SurfaceView";
strcat(command,"" );
temp = popen(command, "r");


I call this once a second. But in about five minutes the process will be over. I checked the log and found that there was a problem in the open. But we don't know what caused it.










share|improve this question













closed as off-topic by Vega, sideshowbarker, jww, Madhur Bhaiya, Makyen Nov 26 '18 at 11:37


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Vega, sideshowbarker, Makyen
If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3





    Do you ever close it?

    – Osiris
    Nov 16 '18 at 6:30






  • 3





    What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

    – Osiris
    Nov 16 '18 at 6:32












  • I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

    – DOBY
    Nov 16 '18 at 6:39







  • 3





    Are you closing it every time before calling it again?

    – Osiris
    Nov 16 '18 at 6:40













-2












-2








-2


0






I am calling the function from C code.



FILE *temp;
char command = "dumpsys SurfaceFlinger --latency SurfaceView";
strcat(command,"" );
temp = popen(command, "r");


I call this once a second. But in about five minutes the process will be over. I checked the log and found that there was a problem in the open. But we don't know what caused it.










share|improve this question














I am calling the function from C code.



FILE *temp;
char command = "dumpsys SurfaceFlinger --latency SurfaceView";
strcat(command,"" );
temp = popen(command, "r");


I call this once a second. But in about five minutes the process will be over. I checked the log and found that there was a problem in the open. But we don't know what caused it.







android c android-ndk






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 '18 at 6:27









DOBYDOBY

275




275




closed as off-topic by Vega, sideshowbarker, jww, Madhur Bhaiya, Makyen Nov 26 '18 at 11:37


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Vega, sideshowbarker, Makyen
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Vega, sideshowbarker, jww, Madhur Bhaiya, Makyen Nov 26 '18 at 11:37


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Vega, sideshowbarker, Makyen
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 3





    Do you ever close it?

    – Osiris
    Nov 16 '18 at 6:30






  • 3





    What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

    – Osiris
    Nov 16 '18 at 6:32












  • I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

    – DOBY
    Nov 16 '18 at 6:39







  • 3





    Are you closing it every time before calling it again?

    – Osiris
    Nov 16 '18 at 6:40












  • 3





    Do you ever close it?

    – Osiris
    Nov 16 '18 at 6:30






  • 3





    What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

    – Osiris
    Nov 16 '18 at 6:32












  • I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

    – DOBY
    Nov 16 '18 at 6:39







  • 3





    Are you closing it every time before calling it again?

    – Osiris
    Nov 16 '18 at 6:40







3




3





Do you ever close it?

– Osiris
Nov 16 '18 at 6:30





Do you ever close it?

– Osiris
Nov 16 '18 at 6:30




3




3





What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

– Osiris
Nov 16 '18 at 6:32






What is strcat supposed to do? You can't add anything to that string. You should check the return value of popen.

– Osiris
Nov 16 '18 at 6:32














I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

– DOBY
Nov 16 '18 at 6:39






I want to check the value of popen, but I cannot check the value because the process has ended. Do you happen to know how to view the error log?

– DOBY
Nov 16 '18 at 6:39





3




3





Are you closing it every time before calling it again?

– Osiris
Nov 16 '18 at 6:40





Are you closing it every time before calling it again?

– Osiris
Nov 16 '18 at 6:40












1 Answer
1






active

oldest

votes


















1














I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"






    share|improve this answer



























      1














      I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"






      share|improve this answer

























        1












        1








        1







        I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"






        share|improve this answer













        I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 9:45









        DOBYDOBY

        275




        275















            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            政党

            天津地下鉄3号線