[gfortran] patch for unlink on open files

FX Coudert fxcoudert@gmail.com
Mon Aug 8 19:13:00 GMT 2005


> Is there any particular reason you're doing the unpack early?
> As opposed to one hunk
> 
> #if !HAVE_UNLINK_OPEN_FILE
>   if (u->flags.status == STATUS_SCRATCH || status == CLOSE_DELETE)
>     {
>       char *path = (char *) alloca (u->file_len + 1);
>       unpack_filename (path, u->file, u->file_len);
>       unlink (path);
>     }
> #endif

The unlink has to be done after the call to close_unit(u), but the call 
frees the memory allocated to u. So, we need to unpack (that will store 
the filename), close the unit and then unlink.

FX



More information about the Fortran mailing list