From: Bert Hubert Date: Mon, 4 Apr 2011 13:18:52 +0000 (+0000) Subject: silence some warning about not checking return value of write() to console. Thanks... X-Git-Tag: auth-3.0~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a652d2701b74eb12a4c258be88be9ffd06b1ca0f;p=pdns silence some warning about not checking return value of write() to console. Thanks to Giel & ssb for nagging about this ;-) git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2142 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/dynlistener.cc b/pdns/dynlistener.cc index e36dfa7d6..b047a07e4 100644 --- a/pdns/dynlistener.cc +++ b/pdns/dynlistener.cc @@ -227,7 +227,8 @@ string DynListener::getLine() } else { if(isatty(0)) - write(1, "% ", 2); + if(write(1, "% ", 2) !=2) + throw AhuException("Writing to console: "+stringerror()); if((len=read(0, &mesg[0], mesg.size())) < 0) throw AhuException("Reading from the control pipe: "+stringerror()); else if(len==0) @@ -263,7 +264,9 @@ void DynListener::sendLine(const string &l) if(!line.empty() && line[line.length()-1]!='\n') line.append("\n"); line.append("\n"); - write(1,line.c_str(),line.length()); + if(write(1,line.c_str(),line.length()) != line.length()) + L<