An error occurs in the open part of the c code used by Android [closed]
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
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
add a comment |
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
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
3
Do you ever close it?
– Osiris
Nov 16 '18 at 6:30
3
What isstrcat
supposed to do? You can't add anything to that string. You should check the return value ofpopen
.
– 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
add a comment |
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
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
android c android-ndk
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
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
3
Do you ever close it?
– Osiris
Nov 16 '18 at 6:30
3
What isstrcat
supposed to do? You can't add anything to that string. You should check the return value ofpopen
.
– 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
add a comment |
3
Do you ever close it?
– Osiris
Nov 16 '18 at 6:30
3
What isstrcat
supposed to do? You can't add anything to that string. You should check the return value ofpopen
.
– 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
add a comment |
1 Answer
1
active
oldest
votes
I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"
add a comment |
I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"
add a comment |
I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"
I got the cause. It was because I didn't "pclose" after doing "popen" elsewhere. I like to say, "Too many open files"
answered Nov 16 '18 at 9:45
DOBYDOBY
275
275
add a comment |
add a comment |
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 ofpopen
.– 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