about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-04T17·55+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-04T17·55+0000
commit705868a8a96a10f70e629433cfffc2d5cd2703eb (patch)
treef5d17323d9719ea3d0e4b00533a7c23df508f216
parent95f4f2cf6102f95abf6948d74907c44c3540eddd (diff)
* Make sure that config.h is included before the system headers,
  because it defines _FILE_OFFSET_BITS.  Without this, on 
  OpenSolaris the system headers define it to be 32, and then 
  the 32-bit stat() ends up being called with a 64-bit "struct 
  stat", or vice versa.

  This also ensures that we get 64-bit file sizes everywhere.

* Remove the redundant call to stat() in parseExprFromFile().
  The file cannot be a symlink because that's the exit condition
  of the loop before.

-rw-r--r--src/libexpr/attr-path.hh4
-rw-r--r--src/libexpr/eval.hh4
-rw-r--r--src/libexpr/get-drvs.hh4
-rw-r--r--src/libexpr/nixexpr.hh4
-rw-r--r--src/libexpr/parser.y10
-rw-r--r--src/libexpr/primops.cc2
-rw-r--r--src/libexpr/value-to-xml.hh6
-rw-r--r--src/libstore/store-api.hh6
-rw-r--r--src/libutil/types.hh2
-rw-r--r--src/nix-hash/nix-hash.cc4
-rw-r--r--src/nix-instantiate/nix-instantiate.cc6
-rw-r--r--src/nix-store/nix-store.cc6
12 files changed, 29 insertions, 29 deletions
diff --git a/src/libexpr/attr-path.hh b/src/libexpr/attr-path.hh
index 33587e5ede..b4f5c29d2e 100644
--- a/src/libexpr/attr-path.hh
+++ b/src/libexpr/attr-path.hh
@@ -1,11 +1,11 @@
 #ifndef __ATTR_PATH_H
 #define __ATTR_PATH_H
 
+#include "eval.hh"
+
 #include <string>
 #include <map>
 
-#include "eval.hh"
-
 
 namespace nix {
 
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 8eec94fcbc..501ac93d01 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -1,12 +1,12 @@
 #ifndef __EVAL_H
 #define __EVAL_H
 
-#include <map>
-
 #include "nixexpr.hh"
 #include "symbol-table.hh"
 #include "hash.hh"
 
+#include <map>
+
 
 namespace nix {
 
diff --git a/src/libexpr/get-drvs.hh b/src/libexpr/get-drvs.hh
index ca7d980027..7b96decf4a 100644
--- a/src/libexpr/get-drvs.hh
+++ b/src/libexpr/get-drvs.hh
@@ -1,13 +1,13 @@
 #ifndef __GET_DRVS_H
 #define __GET_DRVS_H
 
+#include "eval.hh"
+
 #include <string>
 #include <map>
 
 #include <boost/shared_ptr.hpp>
 
-#include "eval.hh"
-
 
 namespace nix {
 
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index b1043a3268..1d03220f64 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -1,10 +1,10 @@
 #ifndef __NIXEXPR_H
 #define __NIXEXPR_H
 
-#include <map>
-
 #include "symbol-table.hh"
 
+#include <map>
+
 
 namespace nix {
 
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 7236bab19c..b0c54339b0 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -15,10 +15,6 @@
    stuff.  So allow it to be excluded. */
 #ifndef BISON_HEADER_HACK
 #define BISON_HEADER_HACK
-    
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 #include "util.hh"
     
@@ -28,6 +24,10 @@
 #include "lexer-tab.hh"
 #define YYSTYPE YYSTYPE // workaround a bug in Bison 2.4
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 
 using namespace nix;
 
@@ -480,8 +480,6 @@ Expr * parseExprFromFile(EvalState & state, Path path)
     }
 
     /* If `path' refers to a directory, append `/default.nix'. */
-    if (stat(path.c_str(), &st))
-        throw SysError(format("getting status of `%1%'") % path);
     if (S_ISDIR(st.st_mode))
         path = canonPath(path + "/default.nix");
 
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 68f66acc74..973670e683 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1,5 +1,5 @@
-#include "misc.hh"
 #include "eval.hh"
+#include "misc.hh"
 #include "globals.hh"
 #include "store-api.hh"
 #include "util.hh"
diff --git a/src/libexpr/value-to-xml.hh b/src/libexpr/value-to-xml.hh
index 0c6de3a8b2..3ebc989ffa 100644
--- a/src/libexpr/value-to-xml.hh
+++ b/src/libexpr/value-to-xml.hh
@@ -1,12 +1,12 @@
 #ifndef __VALUE_TO_XML_H
 #define __VALUE_TO_XML_H
 
-#include <string>
-#include <map>
-
 #include "nixexpr.hh"
 #include "eval.hh"
 
+#include <string>
+#include <map>
+
 namespace nix {
 
 void printValueAsXML(EvalState & state, bool strict, bool location,
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 0590f448c0..6fc0689ba1 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -1,14 +1,14 @@
 #ifndef __STOREAPI_H
 #define __STOREAPI_H
 
+#include "hash.hh"
+#include "serialise.hh"
+
 #include <string>
 #include <map>
 
 #include <boost/shared_ptr.hpp>
 
-#include "hash.hh"
-#include "serialise.hh"
-
 
 namespace nix {
 
diff --git a/src/libutil/types.hh b/src/libutil/types.hh
index f110188da1..fd61746e3f 100644
--- a/src/libutil/types.hh
+++ b/src/libutil/types.hh
@@ -1,6 +1,8 @@
 #ifndef __TYPES_H
 #define __TYPES_H
 
+#include "config.h"
+
 #include <string>
 #include <list>
 #include <set>
diff --git a/src/nix-hash/nix-hash.cc b/src/nix-hash/nix-hash.cc
index 1282af070e..f268e49867 100644
--- a/src/nix-hash/nix-hash.cc
+++ b/src/nix-hash/nix-hash.cc
@@ -1,9 +1,9 @@
-#include <iostream>
-
 #include "hash.hh"
 #include "shared.hh"
 #include "help.txt.hh"
 
+#include <iostream>
+
 
 using namespace nix;
 
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index 4d629ea1b3..2925f9c5ef 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -1,6 +1,3 @@
-#include <map>
-#include <iostream>
-
 #include "globals.hh"
 #include "shared.hh"
 #include "eval.hh"
@@ -13,6 +10,9 @@
 #include "common-opts.hh"
 #include "help.txt.hh"
 
+#include <map>
+#include <iostream>
+
 
 using namespace nix;
 
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index e22ef7efce..ff6538137a 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -1,6 +1,3 @@
-#include <iostream>
-#include <algorithm>
-
 #include "globals.hh"
 #include "misc.hh"
 #include "archive.hh"
@@ -11,6 +8,9 @@
 #include "util.hh"
 #include "help.txt.hh"
 
+#include <iostream>
+#include <algorithm>
+
 
 using namespace nix;
 using std::cin;