Hey,

On windows, using open() followed by fopen() does not work. Hence, in 
edje_cc, where mkstemp (which uses open) is followed by fopen, edje_cc 
fails.

Instead of fopen, we can use fdopen. I pasted a  patch below. Can you 
comment it (like, instead of keeping the filename in the function that i 
modified, why not using it for the fd?

thank you

Vincent

Index: src/bin/edje_cc_out.c
===================================================================
--- src/bin/edje_cc_out.c       (revision 60043)
+++ src/bin/edje_cc_out.c       (working copy)
@@ -708,9 +708,9 @@
  }

  static void
-create_script_file(Eet_File *ef, const char *filename, const Code *cd)
+create_script_file(Eet_File *ef, const char *filename, const Code *cd, 
int fd)
  {
-   FILE *f = fopen(filename, "wb");
+   FILE *f = fdopen(fd, "wb");
     if (!f)
       error_and_abort(ef, "Unable to open temp file \"%s\" for script "
                     "compilation.\n", filename);
@@ -787,7 +787,7 @@

  static void
  compile_script_file(Eet_File *ef, const char *source, const char *output,
-                   int script_num)
+                   int script_num, int fd)
  {
     FILE *f;
     char buf[4096];
@@ -802,7 +802,7 @@
     if (ret < 0 || ret > 1)
       error_and_abort(ef, "Compiling script code not clean.\n");

-   f = fopen(output, "rb");
+   f = fdopen(fd, "rb");
     if (!f)
       error_and_abort(ef, "Unable to open script object \"%s\" for reading.\n",
                     output);
@@ -864,7 +864,7 @@
          error_and_abort(ef, "Unable to open temp file \"%s\" for script 
"
                          "compilation.\n", tmpn);

-       create_script_file(ef, tmpn, cd);
+       create_script_file(ef, tmpn, cd, fd);
        close(fd);

        snprintf(tmpo, PATH_MAX, "%s/edje_cc.amx-tmp-XXXXXX", tmp_dir);
@@ -876,7 +876,7 @@
                             "compilation.\n", tmpn);
          }

-       compile_script_file(ef, tmpn, tmpo, i);
+       compile_script_file(ef, tmpn, tmpo, i, fd);
        close(fd);

        unlink(tmpn);


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to