Unsolved QProcess doesn´t emit finished() when done
-
Can you provide a minimal code sample that triggers that ?
-
i got something like
QStringList arguments; arguments << "can0" << "up"; QProcess::execute("ifconfig", arguments );
but i had it allready with finished() and errorOccured() signals conected to slots -> same result.
I would say my buildroot generated OS makes the problem. -
Really surprising. If you call any other command, do you have the same problem ?
-
No never seen the problem before , and i have a lot of qproccess in my code. From shutdown , reboot, mv , cp to a lot of scripts .
-
Is it only on your device or can you reproduce that on your desktop machine ?
-
On my desktop machine it works fine. But i have no CAN device their.
So i returns that can0 device not exists and goes on normaly. But the the other proccesses are working afterwards. -
Since the can bus is a network device, did you try calling
ifconfig up
on another device ? That might help narrow down the problem. -
No didn´t tried yet. I have it fixed now by running a startup script . Which does exatly the same.
But i will have a look at this problem again when i have some more time. I will let you know if i find out something. -
@LogiSch17 I had a similar problem in that no QProcess::finished() signals were being emitted. The problem was SOLVED by not catching the Unix signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes. Maybe this was your problem too.
-
signal SIGCHLD, which implies that this signal is being used by QProcess to communicate between parent and child processes.
SIGCHLD
is precisely how theQProcess
knows when the child has exited/terminated, so thatQProcess::finished()
can be emitted.