/[gxemul]/trunk/src/disk/bootblock_iso9660.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/disk/bootblock_iso9660.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 43 by dpavlin, Mon Oct 8 16:22:32 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
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   *   *
# Line 102  int iso_load_bootblock(struct machine *m Line 102  int iso_load_bootblock(struct machine *m
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    
# Line 302  printf("\n"); Line 306  printf("\n");
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);
# Line 348  ret: Line 354  ret:
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);

Legend:
Removed from v.43  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26