[pso] [tema2][lin] test - problema cu grep

Andrei Dragus adragus at gmail.com
Fri Apr 2 23:34:17 EEST 2010


Incerc urmatoarele bucati de cod:

int x = system("cat /proc/interrupts | grep \"3:.*uart16550\" &> /dev/null")
;
printf("Got:%d\n",x); //Got: 0

int x = system("cat /proc/interrupts | grep \"3:.*uart16550\"") ;
printf("Got:%d\n",x);// Got:256

Apelul system ar trebui sa intoarca !=0, nu exista nici o linie in
/proc/interrupts care sa semene cu asta.
Nu mi-e clar de ce in primul caz returneaza 0, dar e sigur ca pica testele
din cauza asta.

Multumesc,
Andrei.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/lurker/list/pso.html/attachments/20100402/8310fb96/attachment.htm>


More information about the pso mailing list