diff options
author | 2004-12-08 21:49:02 +0000 | |
---|---|---|
committer | 2004-12-08 21:49:02 +0000 | |
commit | e8c3e7c65824bb623cb131314f0bddf6ec55ee26 (patch) | |
tree | b8180572efd3cbdc4a078c1b2ab430a57a76f9fb /usr.bin/cvs/logmsg.c | |
parent | Fix core dumps for ${@:?word} and ${foo[@]?bar}. With help from (diff) | |
download | wireguard-openbsd-e8c3e7c65824bb623cb131314f0bddf6ec55ee26.tar.xz wireguard-openbsd-e8c3e7c65824bb623cb131314f0bddf6ec55ee26.zip |
complain if we fail to send the log message so the caller doesn't
have to
Diffstat (limited to 'usr.bin/cvs/logmsg.c')
-rw-r--r-- | usr.bin/cvs/logmsg.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index daef6d595c4..3dd1febdb62 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.9 2004/12/08 18:54:23 jfb Exp $ */ +/* $OpenBSD: logmsg.c,v 1.10 2004/12/08 21:49:02 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -302,8 +302,10 @@ cvs_logmsg_send(struct cvsroot *root, const char *msg) const char *mp; char *np, buf[256]; - if (cvs_sendarg(root, "-m", 0) < 0) + if (cvs_sendarg(root, "-m", 0) < 0) { + cvs_log(LP_ERR, "failed to send log message"); return (-1); + } for (mp = msg; mp != NULL; mp = strchr(mp, '\n')) { if (*mp == '\n') @@ -314,8 +316,10 @@ cvs_logmsg_send(struct cvsroot *root, const char *msg) np = strchr(buf, '\n'); if (np != NULL) *np = '\0'; - if (cvs_sendarg(root, buf, (mp == msg) ? 0 : 1) < 0) + if (cvs_sendarg(root, buf, (mp == msg) ? 0 : 1) < 0) { + cvs_log(LP_ERR, "failed to send log message"); return (-1); + } } return (0); |