Ignore:
Timestamp:
Sep 14, 2002, 6:33:59 AM (16 years ago)
Author:
landonf
Message:

Use flock on .darwinports.state file instead of Portfile; gets the flock call out of darwinports.tcl API layer and makes Rob a happier, healthier person

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r645 r646  
    736736        file mkdir $portpath/$workdir
    737737    }
    738     set fd [open "$portpath/$workdir/.darwinports.state" a+]
     738    # flock Portfile
     739        set statefile [file join $portpath $workdir .darwinports.state]
     740    set fd [open $statefile a+]
     741    if [catch {flock $fd -exclusive -noblock} result] {
     742        if {"$result" == "EAGAIN"} {
     743            ui_puts "Waiting for lock on $statefile"
     744        } else {
     745            return -code error "$result obtaining lock on $statefile"
     746        }
     747    }
     748    flock $fd -exclusive
    739749    return $fd
    740750}
     
    859869    dlist_evaluate uplist statusdict [list exec_variant]
    860870}
    861 
Note: See TracChangeset for help on using the changeset viewer.