diff options
| author | Michael Albinus | 2014-11-01 17:47:09 +0100 |
|---|---|---|
| committer | Michael Albinus | 2014-11-01 17:47:09 +0100 |
| commit | 7a2d5600451b377036d3c59ad78015c30ddfc154 (patch) | |
| tree | 2869e7023267db8c63e661a939752c4ae599436c /lisp | |
| parent | 85f20e489e7beab9768a9703b1add7e2bba792f4 (diff) | |
| download | emacs-7a2d5600451b377036d3c59ad78015c30ddfc154.tar.gz emacs-7a2d5600451b377036d3c59ad78015c30ddfc154.zip | |
* 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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 50 |
3 files changed, 40 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a02735a3be..98f0d5e4ff8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-11-01 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-cache.el (tramp-get-file-property) | ||
| 4 | (tramp-set-file-property): Check, that `tramp-cache-get-count-*' | ||
| 5 | and `tramp-cache-set-count-*' are bound. Otherwise, there might | ||
| 6 | be compiler warnings. | ||
| 7 | |||
| 8 | * net/tramp-sh.el (tramp-get-remote-uid, tramp-get-remote-gid): | ||
| 9 | Return -1 respective "UNKNOWN", if uid or gid cannot be determined. | ||
| 10 | |||
| 1 | 2014-11-01 Eli Zaretskii <eliz@gnu.org> | 11 | 2014-11-01 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * progmodes/compile.el (compilation-mode): Turn off deferred | 13 | * progmodes/compile.el (compilation-mode): Turn off deferred |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 056b1bdaf91..a6b7500433b 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -144,7 +144,7 @@ Returns DEFAULT if not set." | |||
| 144 | (tramp-message key 8 "%s %s %s" file property value) | 144 | (tramp-message key 8 "%s %s %s" file property value) |
| 145 | (when (>= tramp-verbose 10) | 145 | (when (>= tramp-verbose 10) |
| 146 | (let* ((var (intern (concat "tramp-cache-get-count-" property))) | 146 | (let* ((var (intern (concat "tramp-cache-get-count-" property))) |
| 147 | (val (or (ignore-errors (symbol-value var)) 0))) | 147 | (val (or (and (boundp var) (symbol-value var)) 0))) |
| 148 | (set var (1+ val)))) | 148 | (set var (1+ val)))) |
| 149 | value)) | 149 | value)) |
| 150 | 150 | ||
| @@ -161,7 +161,7 @@ Returns VALUE." | |||
| 161 | (tramp-message key 8 "%s %s %s" file property value) | 161 | (tramp-message key 8 "%s %s %s" file property value) |
| 162 | (when (>= tramp-verbose 10) | 162 | (when (>= tramp-verbose 10) |
| 163 | (let* ((var (intern (concat "tramp-cache-set-count-" property))) | 163 | (let* ((var (intern (concat "tramp-cache-set-count-" property))) |
| 164 | (val (or (ignore-errors (symbol-value var)) 0))) | 164 | (val (or (and (boundp var) (symbol-value var)) 0))) |
| 165 | (set var (1+ val)))) | 165 | (set var (1+ val)))) |
| 166 | value)) | 166 | value)) |
| 167 | 167 | ||
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 186a51c5bb8..e120aedfc01 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -5289,17 +5289,20 @@ Return ATTR." | |||
| 5289 | 5289 | ||
| 5290 | (defun tramp-get-remote-uid (vec id-format) | 5290 | (defun tramp-get-remote-uid (vec id-format) |
| 5291 | (with-tramp-connection-property vec (format "uid-%s" id-format) | 5291 | (with-tramp-connection-property vec (format "uid-%s" id-format) |
| 5292 | (let ((res (cond | 5292 | (let ((res |
| 5293 | ((tramp-get-remote-id vec) | 5293 | (ignore-errors |
| 5294 | (tramp-get-remote-uid-with-id vec id-format)) | 5294 | (cond |
| 5295 | ((tramp-get-remote-perl vec) | 5295 | ((tramp-get-remote-id vec) |
| 5296 | (tramp-get-remote-uid-with-perl vec id-format)) | 5296 | (tramp-get-remote-uid-with-id vec id-format)) |
| 5297 | ((tramp-get-remote-python vec) | 5297 | ((tramp-get-remote-perl vec) |
| 5298 | (tramp-get-remote-uid-with-python vec id-format)) | 5298 | (tramp-get-remote-uid-with-perl vec id-format)) |
| 5299 | (t (tramp-error | 5299 | ((tramp-get-remote-python vec) |
| 5300 | vec 'file-error "Cannot determine remote uid"))))) | 5300 | (tramp-get-remote-uid-with-python vec id-format)))))) |
| 5301 | ;; The command might not always return a number. | 5301 | ;; Ensure there is a valid result. |
| 5302 | (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) | 5302 | (cond |
| 5303 | ((and (equal id-format 'integer) (not (integerp res))) -1) | ||
| 5304 | ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN") | ||
| 5305 | (t res))))) | ||
| 5303 | 5306 | ||
| 5304 | (defun tramp-get-remote-gid-with-id (vec id-format) | 5307 | (defun tramp-get-remote-gid-with-id (vec id-format) |
| 5305 | (tramp-send-command-and-read | 5308 | (tramp-send-command-and-read |
| @@ -5330,17 +5333,20 @@ Return ATTR." | |||
| 5330 | 5333 | ||
| 5331 | (defun tramp-get-remote-gid (vec id-format) | 5334 | (defun tramp-get-remote-gid (vec id-format) |
| 5332 | (with-tramp-connection-property vec (format "gid-%s" id-format) | 5335 | (with-tramp-connection-property vec (format "gid-%s" id-format) |
| 5333 | (let ((res (cond | 5336 | (let ((res |
| 5334 | ((tramp-get-remote-id vec) | 5337 | (ignore-errors |
| 5335 | (tramp-get-remote-gid-with-id vec id-format)) | 5338 | (cond |
| 5336 | ((tramp-get-remote-perl vec) | 5339 | ((tramp-get-remote-id vec) |
| 5337 | (tramp-get-remote-gid-with-perl vec id-format)) | 5340 | (tramp-get-remote-gid-with-id vec id-format)) |
| 5338 | ((tramp-get-remote-python vec) | 5341 | ((tramp-get-remote-perl vec) |
| 5339 | (tramp-get-remote-gid-with-python vec id-format)) | 5342 | (tramp-get-remote-gid-with-perl vec id-format)) |
| 5340 | (t (tramp-error | 5343 | ((tramp-get-remote-python vec) |
| 5341 | vec 'file-error "Cannot determine remote gid"))))) | 5344 | (tramp-get-remote-gid-with-python vec id-format)))))) |
| 5342 | ;; The command might not always return a number. | 5345 | ;; Ensure there is a valid result. |
| 5343 | (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) | 5346 | (cond |
| 5347 | ((and (equal id-format 'integer) (not (integerp res))) -1) | ||
| 5348 | ((and (equal id-format 'string) (not (stringp res))) "UNKNOWN") | ||
| 5349 | (t res))))) | ||
| 5344 | 5350 | ||
| 5345 | ;; Some predefined connection properties. | 5351 | ;; Some predefined connection properties. |
| 5346 | (defun tramp-get-inline-compress (vec prop size) | 5352 | (defun tramp-get-inline-compress (vec prop size) |