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)
(*root-fid* root-fid))
(assert path)
(with-cloned-root-fid (*stream* cloned-root-fid)
(if dirp
(9p:create-path *stream* cloned-root-fid (if (fs:path-referencing-dir-p path)
path
(text-utils:strcat path "/")))
(9p:create-path *stream* cloned-root-fid path))))))
(with-cloned-root-fid (*stream* cloned-root-fid :clunk-cloned-fid nil)
(let ((created-fid nil))
(if dirp
(setf created-fid
(9p:create-path *stream*
cloned-root-fid
(if (fs:path-referencing-dir-p path)
path
(text-utils:strcat path "/"))))
(setf created-fid
(9p:create-path *stream* cloned-root-fid path)))
(9p:9p-clunk *stream* created-fid))))))
(defun download-node (stream root-fid)
(lambda (node