summaryrefslogtreecommitdiff
path: root/lib/Output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Output.cc')
-rw-r--r--lib/Output.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Output.cc b/lib/Output.cc
index caabfa5..1222ead 100644
--- a/lib/Output.cc
+++ b/lib/Output.cc
@@ -33,6 +33,7 @@
#include <fcntl.h>
#include "Output.h"
#include "Exceptions.h"
+#include "Atomic.h"
#include "gettext.h"
#ifndef S_ISREG
@@ -52,7 +53,7 @@ Output::Output(String no, int create, int trunc) throw (GeneralException) :
throw IOGeneral(String(_("Error opening file ")) + no + _(" for writing: ") + strerror(errno));
}
- nb_output++;
+ Atomic::Increment(&nb_output);
size = lseek(GetHandle(), 0, SEEK_END);
if (trunc)
@@ -107,7 +108,7 @@ int Output::wrapopen(const String & n, int create, int trunc) {
}
Output::Output(const Output & o) : Handle(o), n(o.n) {
- nb_output++;
+ Atomic::Increment(&nb_output);
}
bool Output::CanWrite() const {