Index: commonmod.scm ================================================================== --- commonmod.scm +++ commonmod.scm @@ -25,11 +25,11 @@ (declare (uses ulex)) (declare (uses pkts)) (module commonmod * -(import scheme chicken data-structures extras) +(import scheme (chicken base)) (use (prefix sqlite3 sqlite3:) posix typed-records srfi-18 srfi-1 files format srfi-13 matchable srfi-69 ports (prefix base64 base64:) Index: pkts/pkts.scm ================================================================== --- pkts/pkts.scm +++ pkts/pkts.scm @@ -696,11 +696,11 @@ (cond ((not (file-exists? pktsdir)) (print "ERROR: packets directory " pktsdir " does not exist.")) ((not (directory? pktsdir)) (print "ERROR: packets directory path " pktsdir " is not a directory.")) - ((not (file-read-access? pktsdir)) + ((not (file-readable? pktsdir)) (print "ERROR: packets directory path " pktsdir " is not readable.")) (else ;; (print "INFO: Loading packets found in " pktsdir) (let ((pkts (glob (conc pktsdir "/*.pkt")))) (for-each Index: ulex/ulex.scm ================================================================== --- ulex/ulex.scm +++ ulex/ulex.scm @@ -58,17 +58,26 @@ ;; ;; system ;; get-normalized-cpu-load ;; ) -(import scheme posix-groups (chicken base) queues (chicken port) (chicken io) (chicken file) mailbox) +(import scheme posix-groups (chicken base) queues (chicken port) (chicken io) (chicken file) mailbox system-information) (import srfi-18 pkts matchable regex typed-records srfi-69 srfi-1 srfi-4 regex-case (prefix sqlite3 sqlite3:) - foreign - tcp) ;; ulex-netutil) + (chicken foreign) + (chicken sort) + (chicken process-context posix) + (chicken process-context) + (chicken file posix) + (chicken random) + (chicken pretty-print) + (chicken string) + (chicken time) + (chicken condition) + (chicken tcp)) ;; ulex-netutil) ;;====================================================================== ;; D E B U G H E L P E R S ;;====================================================================== @@ -242,12 +251,12 @@ (cond ((number? num) num) ((string? num) (string->number num)) (else num))) -(use trace) -(trace-call-sites #t) +;;(use trace) +;;(trace-call-sites #t) ;;====================================================================== ;; D A T A B A S E H A N D L I N G ;;====================================================================== @@ -274,12 +283,12 @@ ;; (define (open-db acfg fname) (let* ((fullname (conc (area-dbdir acfg) "/" fname)) (exists (file-exists? fullname)) (write-access (if exists - (file-write-access? fullname) - (file-write-access? (area-dbdir acfg)))) + (file-writable? fullname) + (file-writable? (area-dbdir acfg)))) (db (sqlite3:open-database fullname)) (handler (sqlite3:make-busy-timeout 136000)) ) (sqlite3:set-busy-handler! db handler) (sqlite3:execute db "PRAGMA synchronous = 0;") @@ -366,11 +375,11 @@ ;;====================================================================== (define (register-db-as-mine acfg dbname) (let ((ht (area-dbs acfg))) (if (not (hash-table-ref/default ht dbname #f)) - (hash-table-set! ht dbname (random 10000))))) + (hash-table-set! ht dbname (pseudo-random-integer 10000))))) (define (work-queue-add acfg fname witem) (let* ((work-queue-start (current-milliseconds)) (action (witem-action witem)) ;; NB the action is the index into the rdat actions (qdat (or (hash-table-ref/default (area-wqueues acfg) fname #f)