[gfortran] patch for unlink on open files

Richard Henderson rth@redhat.com
Mon Aug 8 17:47:00 GMT 2005


On Sun, Aug 07, 2005 at 07:59:47PM +0200, FX Coudert wrote:
> +#if !HAVE_UNLINK_OPEN_FILE
> +  char * path;
> +#endif
...
> +#if !HAVE_UNLINK_OPEN_FILE
> +	  path = (char *) alloca (u->file_len + 1);
> +          unpack_filename (path, u->file, u->file_len);
> +#endif
...
> +#if !HAVE_UNLINK_OPEN_FILE
> +      if (u->flags.status == STATUS_SCRATCH || status == CLOSE_DELETE)
> +        unlink (path);
> +#endif

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


r~



More information about the Fortran mailing list