25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: bootblock_iso9660.c,v 1.3 2007/06/15 17:02:39 debug Exp $ |
* $Id: bootblock_iso9660.c,v 1.4 2007/06/23 23:59:14 debug Exp $ |
29 |
* |
* |
30 |
* ISO9660 CD-ROM "bootblock" handling. |
* ISO9660 CD-ROM "bootblock" handling. |
31 |
* |
* |
102 |
unsigned char *dirbuf = NULL, *dp, *match_entry = NULL, *filebuf = NULL; |
unsigned char *dirbuf = NULL, *dp, *match_entry = NULL, *filebuf = NULL; |
103 |
char *p, *filename_orig, *filename, *tmpfname = NULL; |
char *p, *filename_orig, *filename, *tmpfname = NULL; |
104 |
char **new_array; |
char **new_array; |
105 |
|
char *tmpdir = getenv("TMPDIR"); |
106 |
int tmpfile_handle; |
int tmpfile_handle; |
107 |
|
|
108 |
|
if (tmpdir == NULL) |
109 |
|
tmpdir = DEFAULT_TMP_DIR; |
110 |
|
|
111 |
CHECK_ALLOCATION(filename = strdup(cpu->machine->boot_kernel_filename)); |
CHECK_ALLOCATION(filename = strdup(cpu->machine->boot_kernel_filename)); |
112 |
filename_orig = filename; |
filename_orig = filename; |
113 |
|
|
306 |
(long long)fileofs); */ |
(long long)fileofs); */ |
307 |
|
|
308 |
CHECK_ALLOCATION(filebuf = malloc(filelen)); |
CHECK_ALLOCATION(filebuf = malloc(filelen)); |
309 |
tmpfname = strdup("/tmp/gxemul.XXXXXXXXXXXX"); |
|
310 |
|
CHECK_ALLOCATION(tmpfname = malloc(300)); |
311 |
|
snprintf(tmpfname, 300, "%s/gxemul.XXXXXXXXXXXX", tmpdir); |
312 |
|
|
313 |
res2 = diskimage_access(m, disk_id, disk_type, 0, fileofs, filebuf, |
res2 = diskimage_access(m, disk_id, disk_type, 0, fileofs, filebuf, |
314 |
filelen); |
filelen); |
354 |
if (match_entry != NULL) |
if (match_entry != NULL) |
355 |
free(match_entry); |
free(match_entry); |
356 |
|
|
357 |
|
if (tmpfname != NULL) |
358 |
|
free(tmpfname); |
359 |
|
|
360 |
free(filename_orig); |
free(filename_orig); |
361 |
|
|
362 |
debug_indentation(-iadd); |
debug_indentation(-iadd); |