* Remove the fdatasync check since it's no longer needed.
This commit is contained in:
		
							parent
							
								
									bb82310dba
								
							
						
					
					
						commit
						5954eadf67
					
				
					 3 changed files with 2 additions and 8 deletions
				
			
		|  | @ -279,7 +279,6 @@ AC_CHECK_FUNCS([setresuid setreuid lchown]) | |||
| # Nice to have, but not essential. | ||||
| AC_CHECK_FUNCS([strsignal]) | ||||
| AC_CHECK_FUNCS([posix_fallocate]) | ||||
| AC_CHECK_FUNCS([fdatasync]) | ||||
| 
 | ||||
| 
 | ||||
| # This is needed if ATerm or bzip2 are static libraries, | ||||
|  |  | |||
|  | @ -227,13 +227,12 @@ string readFile(const Path & path) | |||
| } | ||||
| 
 | ||||
| 
 | ||||
| void writeFile(const Path & path, const string & s, bool doFsync) | ||||
| void writeFile(const Path & path, const string & s) | ||||
| { | ||||
|     AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666); | ||||
|     if (fd == -1) | ||||
|         throw SysError(format("opening file `%1%'") % path); | ||||
|     writeFull(fd, (unsigned char *) s.c_str(), s.size()); | ||||
|     if (doFsync) fdatasync(fd); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,10 +12,6 @@ | |||
| 
 | ||||
| #include <cstdio> | ||||
| 
 | ||||
| #ifndef HAVE_FDATASYNC | ||||
| #define fdatasync fsync | ||||
| #endif | ||||
| 
 | ||||
| 
 | ||||
| namespace nix { | ||||
| 
 | ||||
|  | @ -66,7 +62,7 @@ string readFile(int fd); | |||
| string readFile(const Path & path); | ||||
| 
 | ||||
| /* Write a string to a file. */ | ||||
| void writeFile(const Path & path, const string & s, bool doFsync = false); | ||||
| void writeFile(const Path & path, const string & s); | ||||
| 
 | ||||
| /* Read a line from a file descriptor. */ | ||||
| string readLine(int fd); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue