Changeset 138165 for trunk/base


Ignore:
Timestamp:
Jun 30, 2015, 8:58:44 PM (5 years ago)
Author:
cal@…
Message:

base: rename pextlib flock to adv-flock to avoid conflict with TclX, closes #46733

This has come up a few times and is somehow related to the order in which the
packages are loaded, but I haven't been able to pinpoint why exactly the order
varies.

Let's avoid wasting any time on the dirty details and just rename our own
implementation. The new name is "adv-flock" for "advisory file lock".

Location:
trunk/base/src
Files:
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/base/src/pextlib1.0/Makefile.in

    r138164 r138165  
    88        fs-traverse.o strcasecmp.o vercomp.o filemap.o base32cmd.o \
    99        sha1cmd.o curl.o rmd160cmd.o sha256cmd.o readline.o uid.o \
    10         tracelib.o tty.o readdir.o pipe.o flock.o system.o \
     10        tracelib.o tty.o readdir.o pipe.o adv-flock.o system.o \
    1111        mktemp.o realpath.o
    1212ifneq (@ac_cv_func_strlcat@,yes)
  • trunk/base/src/pextlib1.0/Pextlib.c

    r135851 r138165  
    9090#include "readdir.h"
    9191#include "pipe.h"
    92 #include "flock.h"
     92#include "adv-flock.h"
    9393#include "system.h"
    9494#include "mktemp.h"
     
    609609
    610610        Tcl_CreateObjCommand(interp, "system", SystemCmd, NULL, NULL);
    611         Tcl_CreateObjCommand(interp, "flock", FlockCmd, NULL, NULL);
     611        Tcl_CreateObjCommand(interp, "adv-flock", AdvFlockCmd, NULL, NULL);
    612612        Tcl_CreateObjCommand(interp, "readdir", ReaddirCmd, NULL, NULL);
    613613        Tcl_CreateObjCommand(interp, "strsed", StrsedCmd, NULL, NULL);
  • trunk/base/src/pextlib1.0/adv-flock.c

    r138164 r138165  
    11/*
    2  * flock.c
     2 * adv-flock.c
    33 * $Id$
    44 *
     
    5252#include <tcl.h>
    5353
    54 #include "flock.h"
     54#include "adv-flock.h"
    5555
    5656static volatile int alarmReceived = 0;
     
    6161
    6262int
    63 FlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
     63AdvFlockCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
    6464    static const char errorstr[] = "use one of \"-shared\", \"-exclusive\", or \"-unlock\", and optionally \"-noblock\"";
    6565    int operation = 0, fd, i, ret, sigret = TCL_OK;
  • trunk/base/src/pextlib1.0/adv-flock.h

    r137292 r138165  
    11/*
    2  * flock.h
     2 * adv-flock.h
    33 * $Id$
    44 *
     
    3131 */
    3232
    33 int FlockCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
     33int AdvFlockCmd(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]);
  • trunk/base/src/port1.0/portutil.tcl

    r138100 r138165  
    18181818    set fd [open $statefile a+]
    18191819    if {![tbool ports_dryrun]} {
    1820         if {[catch {flock $fd -exclusive -noblock} result]} {
     1820        if {[catch {adv-flock $fd -exclusive -noblock} result]} {
    18211821            if {"$result" == "EAGAIN"} {
    18221822                ui_notice "Waiting for lock on $statefile"
    1823                 flock $fd -exclusive
     1823                adv-flock $fd -exclusive
    18241824            } elseif {"$result" == "EOPNOTSUPP"} {
    18251825                # Locking not supported, just return
  • trunk/base/src/registry2.0/registry.tcl

    r128499 r138165  
    396396        set lockfd [::open $lockpath w]
    397397    }
    398     if {[catch {flock $lockfd -exclusive -noblock} result]} {
     398    if {[catch {adv-flock $lockfd -exclusive -noblock} result]} {
    399399        if {$result eq "EAGAIN"} {
    400400            ui_msg "Waiting for lock on $lockpath"
    401             flock $lockfd -exclusive
     401            adv-flock $lockfd -exclusive
    402402        } elseif {$result eq "EOPNOTSUPP"} {
    403403            # Locking not supported, just return
     
    421421    if {[info exists lockfd]} {
    422422        # not much point trying to handle errors
    423         catch {flock $lockfd -unlock}
     423        catch {adv-flock $lockfd -unlock}
    424424    }
    425425}
Note: See TracChangeset for help on using the changeset viewer.