emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117655: * net/tramp-cache.el (tramp-get-file-pro


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r117655: * net/tramp-cache.el (tramp-get-file-property)
Date: Sat, 01 Nov 2014 16:47:30 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117655
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-11-01 17:47:09 +0100
message:
  * net/tramp-cache.el (tramp-get-file-property)
  (tramp-set-file-property): Check, that `tramp-cache-get-count-*'
  and `tramp-cache-set-count-*' are bound.  Otherwise, there might
  be compiler warnings.
  
  * net/tramp-sh.el (tramp-get-remote-uid, tramp-get-remote-gid):
  Return -1 respective "UNKNOWN", if uid or gid cannot be determined.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-cache.el        
trampcache.el-20091113204419-o5vbwnq5f7feedwu-5065
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-01 14:16:53 +0000
+++ b/lisp/ChangeLog    2014-11-01 16:47:09 +0000
@@ -1,3 +1,13 @@
+2014-11-01  Michael Albinus  <address@hidden>
+
+       * net/tramp-cache.el (tramp-get-file-property)
+       (tramp-set-file-property): Check, that `tramp-cache-get-count-*'
+       and `tramp-cache-set-count-*' are bound.  Otherwise, there might
+       be compiler warnings.
+
+       * net/tramp-sh.el (tramp-get-remote-uid, tramp-get-remote-gid):
+       Return -1 respective "UNKNOWN", if uid or gid cannot be determined.
+
 2014-11-01  Eli Zaretskii  <address@hidden>
 
        * progmodes/compile.el (compilation-mode): Turn off deferred

=== modified file 'lisp/net/tramp-cache.el'
--- a/lisp/net/tramp-cache.el   2014-11-01 13:34:45 +0000
+++ b/lisp/net/tramp-cache.el   2014-11-01 16:47:09 +0000
@@ -144,7 +144,7 @@
     (tramp-message key 8 "%s %s %s" file property value)
     (when (>= tramp-verbose 10)
       (let* ((var (intern (concat "tramp-cache-get-count-" property)))
-            (val (or (ignore-errors (symbol-value var)) 0)))
+            (val (or (and (boundp var) (symbol-value var)) 0)))
        (set var (1+ val))))
     value))
 
@@ -161,7 +161,7 @@
     (tramp-message key 8 "%s %s %s" file property value)
     (when (>= tramp-verbose 10)
       (let* ((var (intern (concat "tramp-cache-set-count-" property)))
-            (val (or (ignore-errors (symbol-value var)) 0)))
+            (val (or (and (boundp var) (symbol-value var)) 0)))
        (set var (1+ val))))
     value))
 

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-11-01 14:08:00 +0000
+++ b/lisp/net/tramp-sh.el      2014-11-01 16:47:09 +0000
@@ -5289,17 +5289,20 @@
 
 (defun tramp-get-remote-uid (vec id-format)
   (with-tramp-connection-property vec (format "uid-%s" id-format)
-    (let ((res (cond
-               ((tramp-get-remote-id vec)
-                (tramp-get-remote-uid-with-id vec id-format))
-               ((tramp-get-remote-perl vec)
-                (tramp-get-remote-uid-with-perl vec id-format))
-               ((tramp-get-remote-python vec)
-                (tramp-get-remote-uid-with-python vec id-format))
-               (t (tramp-error
-                   vec 'file-error "Cannot determine remote uid")))))
-      ;; The command might not always return a number.
-      (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
+    (let ((res
+          (ignore-errors
+            (cond
+             ((tramp-get-remote-id vec)
+              (tramp-get-remote-uid-with-id vec id-format))
+             ((tramp-get-remote-perl vec)
+              (tramp-get-remote-uid-with-perl vec id-format))
+             ((tramp-get-remote-python vec)
+              (tramp-get-remote-uid-with-python vec id-format))))))
+      ;; Ensure there is a valid result.
+      (cond
+       ((and (equal id-format 'integer) (not (integerp res))) -1)
+       ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
+       (t res)))))
 
 (defun tramp-get-remote-gid-with-id (vec id-format)
   (tramp-send-command-and-read
@@ -5330,17 +5333,20 @@
 
 (defun tramp-get-remote-gid (vec id-format)
   (with-tramp-connection-property vec (format "gid-%s" id-format)
-    (let ((res (cond
-               ((tramp-get-remote-id vec)
-                (tramp-get-remote-gid-with-id vec id-format))
-               ((tramp-get-remote-perl vec)
-                (tramp-get-remote-gid-with-perl vec id-format))
-               ((tramp-get-remote-python vec)
-                (tramp-get-remote-gid-with-python vec id-format))
-               (t (tramp-error
-                   vec 'file-error "Cannot determine remote gid")))))
-      ;; The command might not always return a number.
-      (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
+    (let ((res
+          (ignore-errors
+            (cond
+             ((tramp-get-remote-id vec)
+              (tramp-get-remote-gid-with-id vec id-format))
+             ((tramp-get-remote-perl vec)
+              (tramp-get-remote-gid-with-perl vec id-format))
+             ((tramp-get-remote-python vec)
+              (tramp-get-remote-gid-with-python vec id-format))))))
+      ;; Ensure there is a valid result.
+      (cond
+       ((and (equal id-format 'integer) (not (integerp res))) -1)
+       ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN")
+       (t res)))))
 
 ;; Some predefined connection properties.
 (defun tramp-get-inline-compress (vec prop size)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]