sometimes Get signal SIGPIPE,although has set its handler

0 views
Skip to first unread message

UnixStudier

unread,
Dec 26, 2008, 5:39:08 AM12/26/08
to memcached
hi,all.I use libmemcached in my c++ program.I set SIGPIPE signal's
handler as follow:
//SIGPIPE
static void handle_pipe(int sig)
{
Logger::log_msg(LOG_WARN,"received a SIGPIPE signal,in file %s time %s
\n",__FILE__,__TIME__);
}
static void set_pipe()
{
struct sigaction action;
action.sa_handler = handle_pipe;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
sigaction(SIGPIPE,&action,NULL);
}

void set_signal()
{
set_pipe();
}

But,SOMEYIMES,my program may still receive this signal.I am very
confused .

Reply all
Reply to author
Forward
0 new messages