1
0
Fork 0

- [kami] prevented a crash (and a fid leak) when creating new files or directories.

This commit is contained in:
cage 2022-02-18 19:20:47 +01:00
parent 7f6c6feace
commit dce7598989
1 changed files with 12 additions and 6 deletions

View File

@ -88,12 +88,18 @@
(let* ((*stream* stream) (let* ((*stream* stream)
(*root-fid* root-fid)) (*root-fid* root-fid))
(assert path) (assert path)
(with-cloned-root-fid (*stream* cloned-root-fid) (with-cloned-root-fid (*stream* cloned-root-fid :clunk-cloned-fid nil)
(let ((created-fid nil))
(if dirp (if dirp
(9p:create-path *stream* cloned-root-fid (if (fs:path-referencing-dir-p path) (setf created-fid
(9p:create-path *stream*
cloned-root-fid
(if (fs:path-referencing-dir-p path)
path path
(text-utils:strcat path "/"))) (text-utils:strcat path "/"))))
(9p:create-path *stream* cloned-root-fid path)))))) (setf created-fid
(9p:create-path *stream* cloned-root-fid path)))
(9p:9p-clunk *stream* created-fid))))))
(defun download-node (stream root-fid) (defun download-node (stream root-fid)
(lambda (node (lambda (node