site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=0Z8YohWQVVpnFmUjIP9M/Oq5Ca3cyWy0OEGlAzqlPOQ=; b=Ym/FGqDBj5VpZX1fNhUlHG+7A51GI/ULRxAixwItzPolGc21bb/CnL1OQxCisF16Al lN/xktU2YkqceAk5ZQp1tMdpmfOEZc25/hG7av1hF1RcD9in+Iv/99+X+tAvQn72DrW9 P4N/L5q6UwJJrolWLyfKO9BaDBmZks15fIfzs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=H+nM1m6h9ic+zKG3PVtd5yWHJJGK+mF7mLiG+wGKFbEYtAH8rMsbf78mItrqgLmCJC hyT80O3cGmZ8ysrpWCd41f/detM2YM/05TYDyclutgBSo+zbKOEBGl1OoWa8+UO5q1OI /zaN1N+NpHMcFmLUUucuRf/T2FTHtiSIUO9EA=
On Feb 17, 2009, at 2:06 PM, Rakesh Singhal wrote:
Hi all,
I am getting SIGPIPE (broken pipe) signal. I have implemented signal handler.
I do not know, why I am getting it in my app. I do not have any sockets in my app. I am communicating with serial port and my own dynamic libraries. How can I find the cause of this signal? Please suggest.
You are writing to descriptor which has nothing on the other side (reading). You should ignore the SIGPIPE signal on all threads and check for errno==EPIPE instead.
To get EPIPE you need set socket to return such a value instead of fire a SIGPIPE. "SO_NOSIGPIPE is an option that prevents SIGPIPE from being raised when a write fails on a socket to which there is no reader; instead, the write to the socket returns with the error EPIPE when there is no reader." int sigPipe = 1; ::setsockopt(_fd, SOL_SOCKET, SO_NOSIGPIPE, (const char*)&sigPipe, sizeof(sigPipe)); Anyway how are you talking with the serial port? -Shawn _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Shawn Erickson