[119939] trunk/base/src/pextlib1.0/flock.c

cal at macports.org cal at macports.org
Sun May 11 04:36:22 PDT 2014


Revision: 119939
          https://trac.macports.org/changeset/119939
Author:   cal at macports.org
Date:     2014-05-11 04:36:22 -0700 (Sun, 11 May 2014)
Log Message:
-----------
base: pextlib1.0/flock.c: Fix uninitialized use of sigret, remove Tcl_SetResult that overwrites the message already set by the signal handling mechanism

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/flock.c

Modified: trunk/base/src/pextlib1.0/flock.c
===================================================================
--- trunk/base/src/pextlib1.0/flock.c	2014-05-11 11:29:43 UTC (rev 119938)
+++ trunk/base/src/pextlib1.0/flock.c	2014-05-11 11:36:22 UTC (rev 119939)
@@ -57,7 +57,7 @@
 int
 FlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
     static const char errorstr[] = "use one of \"-shared\", \"-exclusive\", or \"-unlock\", and optionally \"-noblock\"";
-    int operation = 0, fd, i, ret, sigret;
+    int operation = 0, fd, i, ret, sigret = TCL_OK;
     int errnoval = 0;
     int oshared = 0, oexclusive = 0, ounlock = 0, onoblock = 0, retry = 0;
 #if defined(HAVE_LOCKF) && !defined(HAVE_FLOCK)
@@ -223,7 +223,6 @@
     if (sigret != TCL_OK) {
         /* We received a signal that raised an error. The file hasn't been
          * locked. */
-        Tcl_SetResult(interp, "signal raised an error", TCL_STATIC);
         return sigret;
     }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140511/25c58aad/attachment.html>


More information about the macports-changes mailing list