From 2132d9ddeba14ea2ddcbb16fa51ddb16c45c3c6a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Aug 2006 15:29:38 +0000 Subject: * Fix the ~ operator. --- src/libutil/util.cc | 9 +++++++++ src/libutil/util.hh | 2 ++ 2 files changed, 11 insertions(+) (limited to 'src/libutil') diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 02745498f9..54cfc6c7fd 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -404,6 +404,15 @@ void printMsg_(Verbosity level, const format & f) } +void warnOnce(bool & haveWarned, const format & f) +{ + if (!haveWarned) { + printMsg(lvlError, format("warning: %1%") % f.str()); + haveWarned = true; + } +} + + void readFull(int fd, unsigned char * buf, size_t count) { while (count) { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 22e614d958..125ba2695c 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -178,6 +178,8 @@ void printMsg_(Verbosity level, const format & f); #define debug(f) printMsg(lvlDebug, f) +void warnOnce(bool & haveWarned, const format & f); + /* Wrappers arount read()/write() that read/write exactly the requested number of bytes. */ -- cgit 1.4.1