Changeset 8345


Ignore:
Timestamp:
Jan 29, 2008, 1:03:07 AM (12 years ago)
Author:
gz
Message:

Just use %get-errno, duh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r8343 r8345  
    349349    "unknown"))
    350350
    351 (defun try-hard-to-get-errno (err)
    352   (when (eq err -1)
    353     (let ((nerr (%get-errno)))
    354       (unless (eq nerr 0) (setq err nerr))))
    355   #+darwin-target
    356   (when (eq err -1)
    357     ;; Not thread safe, but what else can I do??
    358     (let ((nerr (pref (foreign-symbol-address "_errno") :signed)))
    359       (unless (eq nerr 0) (setq err nerr))))
    360   err)
    361 
    362351(defun copy-file-attributes (source-path dest-path)
    363352  "Copy the mode, owner, group and modification time of source-path to dest-path.
     
    374363                      (unless (eql err 0)
    375364                        (setq win nil)
    376                         ;; We need the real errno so we can tell if it's a permission
    377                         ;; error or something else...
    378365                        (when (eql err -1)
    379                           (setq err (try-hard-to-get-errno err)))
     366                          (setq err (- (%get-errno))))
    380367                        (unless (eql err #$EPERM) (%errno-disp err dest-path))))))
    381368        (errchk (#_chmod cnamestr mode))
Note: See TracChangeset for help on using the changeset viewer.