[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [bluetooth-dev] sdp_server
> -----Original Message-----
> From: USHA R [mailto:firstname.lastname@example.org]
> Sent: 21 May 2001 13:30
> To: email@example.com
> Subject: [bluetooth-dev] sdp_server
> In the sdp_server function, there is a statement like this:
> if(!(sdpsrv_pid = vfork()))
> execvp(SDPSRV_CMD, args);
> fprintf(stderr, "%s:no such file or directory\n", SDPSRV_CMD);
> 1. Now, the SDPSRV_CMD is executed only if the control is in the child
> thread. What happens when the control goes to the parent thread.
The parent continues to execute, of course.
> 2. OK, suppose the control goes to the child and SDPSRV_CMD
> is excuted, then why the printing of error message?
Because if the execvp() fails to execute the SDP server,
we want the child to report it and then terminate. If the
execvp() does not fail then the child's image is replaced
with the SDP server which starts executing and the message
printing is never reached.
> Please clarify. Thanks in advance.
> Usha Kowshik
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to firstname.lastname@example.org