Mercurial > hg > early-roguelike
comparison srogue/save.c @ 188:135ec7f15ffe
srogue: remove remnants of deleted savefile checks.
save_file() used fstat() and direct write() as part of the inode check
which was deleted in f11eeafc. These operations no longer had any
effect.
| author | John "Elwin" Edwards |
|---|---|
| date | Mon, 03 Aug 2015 07:04:48 -0400 |
| parents | 233be801aa81 |
| children | 3de8058dd549 |
comparison
equal
deleted
inserted
replaced
| 187:233be801aa81 | 188:135ec7f15ffe |
|---|---|
| 158 * Do the actual save of this game to a file | 158 * Do the actual save of this game to a file |
| 159 */ | 159 */ |
| 160 save_file(savef) | 160 save_file(savef) |
| 161 FILE *savef; | 161 FILE *savef; |
| 162 { | 162 { |
| 163 reg int fnum; | |
| 164 int slines = LINES; | 163 int slines = LINES; |
| 165 int scols = COLS; | 164 int scols = COLS; |
| 166 | 165 |
| 167 #ifdef __DJGPP__ /* st_ino w/ DJGPP under WinXP broken */ | 166 #ifdef __DJGPP__ /* st_ino w/ DJGPP under WinXP broken */ |
| 168 _djstat_flags |= _STAT_INODE; /* so turn off computing it for now */ | 167 _djstat_flags |= _STAT_INODE; /* so turn off computing it for now */ |
| 169 #endif | 168 #endif |
| 170 | 169 |
| 171 /* | |
| 172 * force allocation of the buffer now so that inodes, etc | |
| 173 * can be checked when restoring saved games. | |
| 174 */ | |
| 175 fnum = fileno(savef); | |
| 176 fstat(fnum, &sbuf); | |
| 177 write(fnum, "RDK", 4); | |
| 178 lseek(fnum, 0L, 0); | |
| 179 encwrite(version,strlen(version)+1,savef); | 170 encwrite(version,strlen(version)+1,savef); |
| 180 encwrite(&slines,sizeof(slines),savef); | 171 encwrite(&slines,sizeof(slines),savef); |
| 181 encwrite(&scols,sizeof(scols),savef); | 172 encwrite(&scols,sizeof(scols),savef); |
| 182 msg(""); | 173 msg(""); |
| 183 rs_save_file(savef); | 174 rs_save_file(savef); |
| 184 close(fnum); | 175 fclose(savef); |
| 185 md_onsignal_exit(); | 176 md_onsignal_exit(); |
| 186 wclear(cw); | 177 wclear(cw); |
| 187 draw(cw); | 178 draw(cw); |
| 188 } | 179 } |
| 189 | 180 |
