diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2002-03-23 16:17:39 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2002-03-23 16:17:39 +0100 |
commit | c751c195c1a57e6738d402f5b4d42357b8e580d0 (patch) | |
tree | de7c66bb18cc0772d36fa9642ed7afc215f4538c /svdrp.c | |
parent | ef91debc4d181be5c34207cf32d127b3058f4697 (diff) | |
download | vdr-c751c195c1a57e6738d402f5b4d42357b8e580d0.tar.gz vdr-c751c195c1a57e6738d402f5b4d42357b8e580d0.tar.bz2 |
Improved usage of 'safe_write()'
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.34 2002/03/08 17:17:05 kls Exp $ + * $Id: svdrp.c 1.35 2002/03/23 16:17:39 kls Exp $ */ #include "svdrp.h" @@ -340,16 +340,12 @@ bool cSVDRP::Send(const char *s, int length) { if (length < 0) length = strlen(s); - int wbytes = safe_write(file, s, length); - if (wbytes == length) - return true; - if (wbytes < 0) { + if (safe_write(file, s, length) < 0) { LOG_ERROR; file.Close(); + return false; } - else //XXX while...??? - esyslog(LOG_ERR, "Wrote %d bytes to client while expecting %d\n", wbytes, length); - return false; + return true; } void cSVDRP::Reply(int Code, const char *fmt, ...) |