1
0
mirror of https://github.com/fuse-friends/fuse-native synced 2024-10-27 18:34:01 +00:00

strncpy mnt argument + diskutil on osx

This commit is contained in:
Andrew Osheroff 2019-08-06 16:48:15 +02:00
parent f9487a8d34
commit a176a98bf0
2 changed files with 5 additions and 5 deletions

View File

@ -112,8 +112,8 @@ typedef struct {
struct fuse *fuse; struct fuse *fuse;
struct fuse_chan *ch; struct fuse_chan *ch;
char* mnt; char mnt[1024];
char* mntopts; char mntopts[1024];
int mounted; int mounted;
uv_async_t async; uv_async_t async;
@ -914,8 +914,8 @@ NAPI_METHOD(fuse_native_mount) {
uv_mutex_init(&(ft->mut)); uv_mutex_init(&(ft->mut));
uv_sem_init(&(ft->sem), 0); uv_sem_init(&(ft->sem), 0);
ft->mnt = mnt; strncpy(ft->mnt, mnt, 1024);
ft->mntopts = mntopts; strncpy(ft->mntopts, mntopts, 1024);
ft->fuse = fuse; ft->fuse = fuse;
ft->ch = ch; ft->ch = ch;
ft->mounted++; ft->mounted++;

View File

@ -250,7 +250,7 @@ class Fuse extends Nanoresource {
_close (cb) { _close (cb) {
const self = this const self = this
const mnt = JSON.stringify(this.mnt) const mnt = JSON.stringify(this.mnt)
const cmd = os.platform() === 'darwin' ? `umount ${mnt}` : `fusermount -q -u ${mnt}` const cmd = IS_OSX ? `diskutil umount ${mnt}` : `fusermount -q -u ${mnt}`
exec(cmd, err => { exec(cmd, err => {
if (err) return cb(err) if (err) return cb(err)