libdraw: fix mount() error handling in newwindow()

This commit is contained in:
cinap_lenrek 2020-05-02 17:05:17 +02:00
parent 19cc46bc5e
commit 7ff6ea0f70

View file

@ -25,8 +25,15 @@ newwindow(char *str)
snprint(buf, sizeof buf, "new %s", str);
else
strcpy(buf, "new");
if(mount(fd, -1, "/mnt/wsys", MREPL, buf) < 0)
return mount(fd, -1, "/dev", MBEFORE, buf);
return bind("/mnt/wsys", "/dev", MBEFORE);
if(mount(fd, -1, "/mnt/wsys", MREPL, buf) == -1){
if(mount(fd, -1, "/dev", MBEFORE, buf) == -1){
close(fd);
return -1;
}
} else {
if(bind("/mnt/wsys", "/dev", MBEFORE) == -1)
return -1;
}
return 0;
}