public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Franz Haeuslschmid <lukrez@gmx.at>
To: cygwin@cygwin.com
Subject: [Patch] EPS import for XFig
Date: Wed, 05 Oct 2005 11:21:00 -0000	[thread overview]
Message-ID: <di0cra$d4d$1@sea.gmane.org> (raw)

Hello,

there is a problem with XFig as soon as more than one EPS should
be imported as figure object.  It seems that only those users are
affected, that use a temporary directory on a NTFS partition.
The problem has been addressed earlier:

  <URL:http://article.gmane.org/gmane.os.cygwin.xfree/14757>

  <URL:http://thread.gmane.org/gmane.os.cygwin/40818>

and finally

  <URL:http://article.gmane.org/gmane.os.cygwin/69899>

An inspection of XFig's source code revealed that a call to
`unlink' in order to remove a temporary bitmap preview of the EPS
to include delays the actual deletion.  The bitmap preview for
subsequent EPS files would go to a temporary file always having
the same name.  As the deletion of the first preview is pending
(which means that the preview file is still there, without any
file permissions), subsequent previews having the same file name
can't be created and the import fails.

The cause for the delay of the deletion is, that there is still a
`FILE' object in memory that references that file.  The patch
forces the file to be closed as soon as it isn't needed any more.

Regards,
Franz.

2005-10-05  Franz Haeuslschmid  <lukrez@gmx.at>

	* f_readeps.c (bitmap_from_gs): Ensures that all FILE objects
	referring to the temporary bitmap preview are closed before the
	preview file is unlinked.

--- f_readeps.c.orig	2005-10-05 11:17:05.985950000 +0200
+++ f_readeps.c	2005-10-05 11:19:29.095325000 +0200
@@ -407,6 +407,7 @@ Boolean
         ht = pic->pic_cache->size_y;
         pcxfile = open_picfile(pixnam, &filtyp, PIPEOK, tmpfile);
         status = _read_pcx(pcxfile, pic);
+        fclose(pcxfile);
         /* restore width/height */
         pic->pic_cache->size_x = wid;
         pic->pic_cache->size_y = ht;


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

             reply	other threads:[~2005-10-05 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05 11:21 Franz Haeuslschmid [this message]
2006-05-13 13:57 ` Franz Haeuslschmid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='di0cra$d4d$1@sea.gmane.org' \
    --to=lukrez@gmx.at \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).