1201 fclose(tmp_stream); |
1201 fclose(tmp_stream); |
1202 } |
1202 } |
1203 |
1203 |
1204 // remember time s.t. we can later check if the file has changed |
1204 // remember time s.t. we can later check if the file has changed |
1205 SYS_STAT tmp_stat; |
1205 SYS_STAT tmp_stat; |
1206 // TODO: maybe add sys_fstat |
|
1207 if(sys_stat(outfile, &tmp_stat)) { |
1206 if(sys_stat(outfile, &tmp_stat)) { |
1208 perror("Cannot stat temporary file"); |
1207 perror("Cannot stat temporary file"); |
1209 close(tmp_fd); |
1208 close(tmp_fd); |
1210 unlink(outfile); |
1209 unlink(outfile); |
1211 return -1; |
1210 return -1; |