Revision: 963
Author: [email protected]
Date: Fri Dec 18 07:09:22 2009
Log: Change NYTP_close() from returning pass/fail to returning pass/errno.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=963

Modified:
  /trunk/NYTProf.xs

=======================================
--- /trunk/NYTProf.xs   Fri Dec 18 07:09:18 2009
+++ /trunk/NYTProf.xs   Fri Dec 18 07:09:22 2009
@@ -909,7 +909,7 @@
          close(fileno(raw_file));
      }

-    return fclose(raw_file);
+    return fclose(raw_file) == 0 ? 0 : errno;
  }


@@ -2121,6 +2121,7 @@

  static void
  close_output_file(pTHX) {
+    int result;
      if (!out)
          return;

@@ -2133,8 +2134,8 @@
      output_tag_int(NYTP_TAG_PID_END, last_pid);
      output_nv(gettimeofday_nv());

-    if (-1 == NYTP_close(out, 0))
-        logwarn("Error closing profile data file: %s\n", strerror(errno));
+    if ((result = NYTP_close(out, 0)))
+        logwarn("Error closing profile data file: %s\n", strerror(result));
      out = NULL;
  }

-- 
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]

Reply via email to