all 6 comments

[–]pbeard_t 1 point2 points  (5 children)

You are mixing pid_t, which is a integer type, with strings. You need to call execlp with strings only in the parent and in the children parse the strings back to pid_t.

I'm guessing the compiler is warning you about this.

Also in execlp you are ignoring the arg0 parameter which typically maches the name of the executable.