Ticket #1352: unix-sockets-path-resolution.diff

File unix-sockets-path-resolution.diff, 1.6 KB (added by Caolan McMahon, 7 years ago)
  • unix-sockets.meta

    diff -u a/unix-sockets.meta b/unix-sockets.meta
    a b  
    33 (files "unix-sockets.scm" "unix-sockets.release-info" "unix-sockets.meta" "unix-sockets.setup")
    44 (synopsis "UNIX domain sockets")
    55 (category net)
    6  (needs easyffi)
     6 (needs easyffi pathname-expand)
    77 (platform unix)
    88 (license "BSD")
    99 (doc-from-wiki)
  • unix-sockets.scm

    diff -u a/unix-sockets.scm b/unix-sockets.scm
    a b  
    4747
    4848;; TODO: errno should be accessed using the proper API?
    4949(import scheme (except chicken errno) easyffi foreign)
    50 (use ports posix)
     50(use ports posix pathname-expand)
    5151
    5252#>
    5353#include <fcntl.h>
     
    161161    (make-property-condition 'unix 'errno errno) ) ) )
    162162
    163163(define (unix-connect filename)
    164   (let ([n (##sys#pathname-resolution filename (lambda (f) (connect_to_server f)))])
     164  (let ([n (connect_to_server (pathname-expand filename))])
    165165    (if (negative? n)
    166166        (unix-error 'unix-connect "can not connect" filename)
    167167        (io-ports 'unix-connect n) ) ) )
     
    292292(define (unix-listen filename #!optional (backlog 10))
    293293  (when (file-exists? filename)
    294294    (delete-file filename) )
    295   (let ([n (##sys#pathname-resolution filename (lambda (name) (create_socket name backlog)))])
     295  (let ([n (create_socket (pathname-expand filename) backlog)])
    296296    (if (negative? n)
    297297        (unix-error 'unix-listen "can not create socket" filename)
    298298        (##sys#make-structure 'unix-listener n filename) ) ) )