about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21T11·17+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21T11·17+0000
commitbd955e15e1aac8a1490a680b9f5cfcce29f2331a (patch)
treef56e21d3608bb14ae3ca89e2ddc6c7c887bfbd85 /src/libutil/util.cc
parent9819bb20da130509ab62f303267331c2403b043c (diff)
* GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour and
  Armijn Hemel.

Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 822c87a05009..f978856a96cc 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <cerrno>
 #include <cstdio>
+#include <cstdlib>
 #include <sstream>
 #include <cstring>
 
@@ -529,13 +530,14 @@ AutoDelete::AutoDelete(const string & p, bool recursive) : path(p)
 AutoDelete::~AutoDelete()
 {
     try {
-        if (del)
+        if (del) {
             if (recursive)
                 deletePath(path);
             else {
                 if (remove(path.c_str()) == -1)
                     throw SysError(format("cannot unlink `%1%'") % path);
             }
+        }
     } catch (...) {
         ignoreException();
     }