* 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.
This commit is contained in:
		
							parent
							
								
									95f4f2cf61
								
							
						
					
					
						commit
						705868a8a9
					
				
					 12 changed files with 29 additions and 29 deletions
				
			
		|  | @ -1,11 +1,11 @@ | ||||||
| #ifndef __ATTR_PATH_H | #ifndef __ATTR_PATH_H | ||||||
| #define __ATTR_PATH_H | #define __ATTR_PATH_H | ||||||
| 
 | 
 | ||||||
|  | #include "eval.hh" | ||||||
|  | 
 | ||||||
| #include <string> | #include <string> | ||||||
| #include <map> | #include <map> | ||||||
| 
 | 
 | ||||||
| #include "eval.hh" |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,12 +1,12 @@ | ||||||
| #ifndef __EVAL_H | #ifndef __EVAL_H | ||||||
| #define __EVAL_H | #define __EVAL_H | ||||||
| 
 | 
 | ||||||
| #include <map> |  | ||||||
| 
 |  | ||||||
| #include "nixexpr.hh" | #include "nixexpr.hh" | ||||||
| #include "symbol-table.hh" | #include "symbol-table.hh" | ||||||
| #include "hash.hh" | #include "hash.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <map> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,13 +1,13 @@ | ||||||
| #ifndef __GET_DRVS_H | #ifndef __GET_DRVS_H | ||||||
| #define __GET_DRVS_H | #define __GET_DRVS_H | ||||||
| 
 | 
 | ||||||
|  | #include "eval.hh" | ||||||
|  | 
 | ||||||
| #include <string> | #include <string> | ||||||
| #include <map> | #include <map> | ||||||
| 
 | 
 | ||||||
| #include <boost/shared_ptr.hpp> | #include <boost/shared_ptr.hpp> | ||||||
| 
 | 
 | ||||||
| #include "eval.hh" |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,10 +1,10 @@ | ||||||
| #ifndef __NIXEXPR_H | #ifndef __NIXEXPR_H | ||||||
| #define __NIXEXPR_H | #define __NIXEXPR_H | ||||||
| 
 | 
 | ||||||
| #include <map> |  | ||||||
| 
 |  | ||||||
| #include "symbol-table.hh" | #include "symbol-table.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <map> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -16,10 +16,6 @@ | ||||||
| #ifndef BISON_HEADER_HACK | #ifndef BISON_HEADER_HACK | ||||||
| #define BISON_HEADER_HACK | #define BISON_HEADER_HACK | ||||||
| 
 | 
 | ||||||
| #include <stdio.h> |  | ||||||
| #include <stdlib.h> |  | ||||||
| #include <string.h> |  | ||||||
| 
 |  | ||||||
| #include "util.hh" | #include "util.hh" | ||||||
|      |      | ||||||
| #include "nixexpr.hh" | #include "nixexpr.hh" | ||||||
|  | @ -28,6 +24,10 @@ | ||||||
| #include "lexer-tab.hh" | #include "lexer-tab.hh" | ||||||
| #define YYSTYPE YYSTYPE // workaround a bug in Bison 2.4 | #define YYSTYPE YYSTYPE // workaround a bug in Bison 2.4 | ||||||
| 
 | 
 | ||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include <string.h> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| using namespace nix; | using namespace nix; | ||||||
| 
 | 
 | ||||||
|  | @ -480,8 +480,6 @@ Expr * parseExprFromFile(EvalState & state, Path path) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /* If `path' refers to a directory, append `/default.nix'. */ |     /* 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)) |     if (S_ISDIR(st.st_mode)) | ||||||
|         path = canonPath(path + "/default.nix"); |         path = canonPath(path + "/default.nix"); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| #include "misc.hh" |  | ||||||
| #include "eval.hh" | #include "eval.hh" | ||||||
|  | #include "misc.hh" | ||||||
| #include "globals.hh" | #include "globals.hh" | ||||||
| #include "store-api.hh" | #include "store-api.hh" | ||||||
| #include "util.hh" | #include "util.hh" | ||||||
|  |  | ||||||
|  | @ -1,12 +1,12 @@ | ||||||
| #ifndef __VALUE_TO_XML_H | #ifndef __VALUE_TO_XML_H | ||||||
| #define __VALUE_TO_XML_H | #define __VALUE_TO_XML_H | ||||||
| 
 | 
 | ||||||
| #include <string> |  | ||||||
| #include <map> |  | ||||||
| 
 |  | ||||||
| #include "nixexpr.hh" | #include "nixexpr.hh" | ||||||
| #include "eval.hh" | #include "eval.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <string> | ||||||
|  | #include <map> | ||||||
|  | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
| void printValueAsXML(EvalState & state, bool strict, bool location, | void printValueAsXML(EvalState & state, bool strict, bool location, | ||||||
|  |  | ||||||
|  | @ -1,14 +1,14 @@ | ||||||
| #ifndef __STOREAPI_H | #ifndef __STOREAPI_H | ||||||
| #define __STOREAPI_H | #define __STOREAPI_H | ||||||
| 
 | 
 | ||||||
|  | #include "hash.hh" | ||||||
|  | #include "serialise.hh" | ||||||
|  | 
 | ||||||
| #include <string> | #include <string> | ||||||
| #include <map> | #include <map> | ||||||
| 
 | 
 | ||||||
| #include <boost/shared_ptr.hpp> | #include <boost/shared_ptr.hpp> | ||||||
| 
 | 
 | ||||||
| #include "hash.hh" |  | ||||||
| #include "serialise.hh" |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| namespace nix { | namespace nix { | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,8 @@ | ||||||
| #ifndef __TYPES_H | #ifndef __TYPES_H | ||||||
| #define __TYPES_H | #define __TYPES_H | ||||||
| 
 | 
 | ||||||
|  | #include "config.h" | ||||||
|  | 
 | ||||||
| #include <string> | #include <string> | ||||||
| #include <list> | #include <list> | ||||||
| #include <set> | #include <set> | ||||||
|  |  | ||||||
|  | @ -1,9 +1,9 @@ | ||||||
| #include <iostream> |  | ||||||
| 
 |  | ||||||
| #include "hash.hh" | #include "hash.hh" | ||||||
| #include "shared.hh" | #include "shared.hh" | ||||||
| #include "help.txt.hh" | #include "help.txt.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <iostream> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| using namespace nix; | using namespace nix; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,3 @@ | ||||||
| #include <map> |  | ||||||
| #include <iostream> |  | ||||||
| 
 |  | ||||||
| #include "globals.hh" | #include "globals.hh" | ||||||
| #include "shared.hh" | #include "shared.hh" | ||||||
| #include "eval.hh" | #include "eval.hh" | ||||||
|  | @ -13,6 +10,9 @@ | ||||||
| #include "common-opts.hh" | #include "common-opts.hh" | ||||||
| #include "help.txt.hh" | #include "help.txt.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <map> | ||||||
|  | #include <iostream> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| using namespace nix; | using namespace nix; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,3 @@ | ||||||
| #include <iostream> |  | ||||||
| #include <algorithm> |  | ||||||
| 
 |  | ||||||
| #include "globals.hh" | #include "globals.hh" | ||||||
| #include "misc.hh" | #include "misc.hh" | ||||||
| #include "archive.hh" | #include "archive.hh" | ||||||
|  | @ -11,6 +8,9 @@ | ||||||
| #include "util.hh" | #include "util.hh" | ||||||
| #include "help.txt.hh" | #include "help.txt.hh" | ||||||
| 
 | 
 | ||||||
|  | #include <iostream> | ||||||
|  | #include <algorithm> | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| using namespace nix; | using namespace nix; | ||||||
| using std::cin; | using std::cin; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue