Changeset 27070 in project


Ignore:
Timestamp:
07/18/12 15:01:55 (9 years ago)
Author:
Alex Shinn
Message:

fixing errno conflict in pty

Location:
release/4/pty/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/pty/trunk/pty.scm

    r20027 r27070  
    11;;;; pty.scm -- Easy Pseudo-Terminal Interface
    22;;
    3 ;; Copyright (c) 2006 Alex Shinn. All rights reserved.
     3;; Copyright (c) 2006-2012 Alex Shinn. All rights reserved.
    44;; BSD-style license: http://synthcode.com/license.txt
    55
     
    1212(require-library posix)
    1313
    14 #+(and unix (not macosx)) (foreign-declare "#include <pty.h>\n")
    15 #+macosx                  (foreign-declare "#include <util.h>\n")
     14#+linux        (foreign-declare "#include <pty.h>\n")
     15#+(not linux)  (foreign-declare "#include <util.h>\n")
    1616(foreign-declare "#include <utmp.h>\n")
    1717(foreign-declare "#include <fcntl.h>\n")
     
    6868(define-constant +input-buffer-size+ 1024)
    6969
    70 (define-foreign-variable errno int "errno")
     70(define-foreign-variable error-number int "errno")
    7171(define-foreign-variable strerror c-string "strerror(errno)")
    7272
    7373(define-foreign-variable _ewouldblock int "EWOULDBLOCK")
     74(define-foreign-variable _eagain int "EAGAIN")
    7475
    7576(define-inline (file-error msg fd)
     
    9495                     (let ((n (file-read/maybe fd buf +input-buffer-size+)))
    9596                       (if (< n 1)
    96                          (if (or (eq? n 0) (eq? errno _ewouldblock))
     97                         (if (or (eq? n 0)
     98                                 (eq? error-number _ewouldblock)
     99                                 (eq? error-number _eagain))
    97100                           (if (more?)
    98101                             (begin
     
    105108                             (let ((n (file-read/maybe fd buf +input-buffer-size+)))
    106109                               (if (= n -1)
    107                                  (if (eq? errno _ewouldblock)
     110                                 (if (or (eq? error-number _ewouldblock)
     111                                         (eq? error-number _eagain))
    108112                                   0
    109113                                   (file-error "can't read from FD - " fd))
  • release/4/pty/trunk/pty.setup

    r20078 r27070  
    11
    2 #+(and unix (not macosx))
     2#+(not macosx)
    33(compile -shared -O3 -j pty -lutil pty.scm)
    44#+macosx
     
    99(install-extension 'pty
    1010  '("pty.so" "pty.import.so")
    11   '((version 1.3)))
     11  '((version 1.4)))
Note: See TracChangeset for help on using the changeset viewer.