[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [bluetooth-dev] sdp_server



> -----Original Message-----
> From: USHA R [mailto:ushar@xxxxxxx.net]
> Sent: 21 May 2001 13:30
> To: bluetooth-dev@xxxxxxx.com
> Subject: [bluetooth-dev] sdp_server
> 
> Hi,
> 	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);
> 		     _exit(0);
> 		}
> 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.
> 
> Regards
> -----------------------------
> Usha Kowshik

//Peter
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com