diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-08-29T15·29+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-08-29T15·29+0000 |
commit | 2132d9ddeba14ea2ddcbb16fa51ddb16c45c3c6a (patch) | |
tree | d77c3bd42f0a13c9fc78e58e6558c5deab8d99d2 /src/libutil | |
parent | 1f6616dabff48028b2b08fc50889707928201ea6 (diff) |
* Fix the ~ operator.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.cc | 9 | ||||
-rw-r--r-- | src/libutil/util.hh | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 02745498f9fc..54cfc6c7fded 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 22e614d9585e..125ba2695c2c 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. */ |