Changeset 9388 in project


Ignore:
Timestamp:
03/09/08 20:49:37 (12 years ago)
Author:
sjamaan
Message:

Fix problem with alloc-bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/9p/trunk/9p-client.scm

    r9385 r9388  
    229229
    230230(define (alloc-bit! bit-vector max)
    231   (let loop ((highest 0))
     231  (let loop ((highest 0)
     232             (size (bit-vector-length bit-vector)))
    232233    (cond
     234     ((= (add1 highest) size)
     235      (values highest (bit-vector-set! bit-vector (add1 highest) #t)))
    233236     ((bit-vector-full? bit-vector (add1 highest))
    234       (loop (add1 highest)))
     237      (loop (add1 highest) size))
    235238     ((>= highest max)
    236239      (error "Cannot allocate new bit for bit-vector"))
    237240     (else
    238241      (bit-vector-set! bit-vector highest #t)
    239       (values highest bit-vector)))))
     242      (values highest (bit-vector-set! bit-vector (add1 highest) #t))))))
    240243
    241244;; Allocate the lowest fid that's not in use yet and return a handle to it
     
    432435       is-dir))))
    433436
    434 ;; TODO: Find out if this is enough.  9p supports no symlinks?
    435437(define (9p:regular-file? con file)
    436438  (not (9p:directory? con file)))
Note: See TracChangeset for help on using the changeset viewer.