ref: 0189d754455dcccbf68e343eeaaf64b103bb8abe
parent: 4744046d0a2b9f55370e6b7a3c1a10ae3352968a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 2 13:05:17 EDT 2020
libdraw: fix mount() error handling in newwindow()
--- a/sys/src/libdraw/newwindow.c
+++ b/sys/src/libdraw/newwindow.c
@@ -25,8 +25,15 @@
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;
}
--
⑨