mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	Replaced readsome() with read() and gcount()
This commit is contained in:
		
							parent
							
								
									cf85aab62f
								
							
						
					
					
						commit
						c3e9922b5d
					
				
					 4 changed files with 11 additions and 23 deletions
				
			
		|  | @ -68,10 +68,13 @@ struct WriteFileFrontend : public Frontend { | |||
| 
 | ||||
| 		FILE *of = fopen(output_filename.c_str(), append_mode ? "a" : "w"); | ||||
| 		char buffer[64 * 1024]; | ||||
| 		size_t bytes; | ||||
| 
 | ||||
| 		while (0 < (bytes = readsome(*f, buffer, sizeof(buffer)))) | ||||
| 			fwrite(buffer, bytes, 1, of); | ||||
| 		while (1) { | ||||
| 			f->read(buffer, sizeof(buffer)); | ||||
| 			if (f->gcount() <= 0) | ||||
| 				break; | ||||
| 			fwrite(buffer, f->gcount(), 1, of); | ||||
| 		} | ||||
| 
 | ||||
| 		fclose(of); | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue