Re: [Interest] Return value from QProcess

2016-04-07 Thread Thiago Macieira
On quinta-feira, 7 de abril de 2016 15:40:59 PDT Duane wrote: > > In the last two cases, the return value is a "wait status" that > > can > > be examined using the macros described in waitpid(2). (i.e., > > WIFEXITED(), WEXITSTATUS(), and so on). > > Ok thanks.

Re: [Interest] Return value from QProcess

2016-04-07 Thread Duane
On 07/04/2016 12:16 PM, Thiago Macieira wrote: On quinta-feira, 7 de abril de 2016 08:47:05 PDT Duane wrote: /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ #define __WEXITSTATUS(status) (((status) & 0xff00) >> 8) BTW $ printf %x\\n 4531 11b3 0x11 is 17. So QProcess is cor

Re: [Interest] Return value from QProcess

2016-04-07 Thread Thiago Macieira
On quinta-feira, 7 de abril de 2016 08:47:05 PDT Duane wrote: > >> /* If WIFEXITED(STATUS), the low-order 8 bits of the status. */ > >> #define__WEXITSTATUS(status) (((status) & 0xff00) >> 8) > > > > BTW > > > > $ printf %x\\n 4531 > > 11b3 > > > > 0x11 is 17. So QProcess is correct. > >

Re: [Interest] Return value from QProcess

2016-04-07 Thread Duane
On 06/04/2016 1:22 PM, Thiago Macieira wrote: On quarta-feira, 6 de abril de 2016 08:47:58 PDT Thiago Macieira wrote: On quarta-feira, 6 de abril de 2016 10:47:39 PDT Duane wrote: This works in the sense that it returns 0 when there's no error but it doesn't seem to return the return value from

Re: [Interest] Return value from QProcess

2016-04-07 Thread Duane
On 06/04/2016 3:00 PM, Jérôme Godbout wrote: You should use a more complete bash command that perform the insert mod, not an actual command but just the raw idea here: if [[ $(lsmod | grep "Profibus") != "ProfileBus" ]]; then insmod Profibus fi Maybe you should check with modprobe to check if t

Re: [Interest] Return value from QProcess

2016-04-06 Thread Jérôme Godbout
You should use a more complete bash command that perform the insert mod, not an actual command but just the raw idea here: if [[ $(lsmod | grep "Profibus") != "ProfileBus" ]]; then insmod Profibus fi Maybe you should check with modprobe to check if the -i or -f flag can help you to get proper beh

Re: [Interest] Return value from QProcess

2016-04-06 Thread Duane
On 06/04/2016 11:47 AM, Thiago Macieira wrote: On quarta-feira, 6 de abril de 2016 10:47:39 PDT Duane wrote: This works in the sense that it returns 0 when there's no error but it doesn't seem to return the return value from insmod. For example, insmod returns 4531 when the file is already load

Re: [Interest] Return value from QProcess

2016-04-06 Thread Thiago Macieira
On quarta-feira, 6 de abril de 2016 08:47:58 PDT Thiago Macieira wrote: > On quarta-feira, 6 de abril de 2016 10:47:39 PDT Duane wrote: > > This works in the sense that it returns 0 when there's no error but it > > doesn't seem to return the return value from insmod. For example, > > insmod return

Re: [Interest] Return value from QProcess

2016-04-06 Thread Thiago Macieira
On quarta-feira, 6 de abril de 2016 10:47:39 PDT Duane wrote: > This works in the sense that it returns 0 when there's no error but it > doesn't seem to return the return value from insmod. For example, > insmod returns 4531 when the file is already loaded but > QProcess::exitCode is 17. I can

Re: [Interest] Return value from QProcess

2016-04-06 Thread Duane
On 06/04/2016 11:09 AM, Robert Buchinger wrote: On Wednesday, April 6, 2016 10:47:39 AM CEST Duane wrote: On 06/04/2016 10:39 AM, Konstantin Tokarev wrote: 06.04.2016, 17:36, "Duane" : Qt 5.3, on TinyCore Linux 5 and Fedora 23. I'm currently using a call to std::system to load a module with

Re: [Interest] Return value from QProcess

2016-04-06 Thread Robert Buchinger
On Wednesday, April 6, 2016 10:47:39 AM CEST Duane wrote: > On 06/04/2016 10:39 AM, Konstantin Tokarev wrote: > > > > > > 06.04.2016, 17:36, "Duane" : > >> Qt 5.3, on TinyCore Linux 5 and Fedora 23. > >> > >> I'm currently using a call to std::system to load a module with insmod. > >>This works

Re: [Interest] Return value from QProcess

2016-04-06 Thread Duane
On 06/04/2016 10:39 AM, Konstantin Tokarev wrote: 06.04.2016, 17:36, "Duane" : Qt 5.3, on TinyCore Linux 5 and Fedora 23. I'm currently using a call to std::system to load a module with insmod. This works but I would like to do it with QProcess. Why? I want to wait for finished with

Re: [Interest] Return value from QProcess

2016-04-06 Thread Konstantin Tokarev
06.04.2016, 17:36, "Duane" : > Qt 5.3, on TinyCore Linux 5 and Fedora 23. > > I'm currently using a call to std::system to load a module with insmod. >   This works but I would like to do it with QProcess. Why? > This also works > but I can't seem to get the return value of the insmod call like

[Interest] Return value from QProcess

2016-04-06 Thread Duane
Qt 5.3, on TinyCore Linux 5 and Fedora 23. I'm currently using a call to std::system to load a module with insmod. This works but I would like to do it with QProcess. This also works but I can't seem to get the return value of the insmod call like I can with std::system. Any suggestions?