qa: fix CID 168327 and CID 168326

This commit is contained in:
Giacomo Tesio 2017-05-04 00:22:50 +02:00
parent ec8d3427b7
commit bd8ced55f1
2 changed files with 8 additions and 2 deletions

View File

@ -38,7 +38,10 @@ main() {
else /* parent */
{
close(p[1]);
read(p[0], &dummy, 1);
if(read(p[0], &dummy, 1) > 0){
printf("sync read received data");
exit(EXIT_FAILURE);
}
close(p[0]);
printf("\nPARENT: sending SIGHUP\n\n");
kill(pid,SIGHUP);

View File

@ -33,7 +33,10 @@ main() {
else /* parent */
{
close(p[1]);
read(p[0], &dummy, 1);
if(read(p[0], &dummy, 1) > 0){
printf("sync read received data");
exit(EXIT_FAILURE);
}
close(p[0]);
printf("\nPARENT: sending SIGQUIT\n\n");
kill(pid,SIGQUIT);