Commit 29e0c5c
authored
🐛 Don't test "Resource busy" when detaching (#200)
1. We have EBUSY (code 16)
https://ss64.com/osx/hdiutil.html said:
> [EBUSY] Resource busy. Used if necessary exclusive access
cannot be obtained. This error often appears when a
volume can't be unmounted.
"EBUSY" can be found in /sys/errno.h of the BSD kernel:
https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/errno.h#L108 :
> #define EBUSY 16 /* Device / Resource busy */
https://github.com/freebsd/freebsd-src/blob/1e0a518d65488caafff89a4ecba9cfb2be233379/sys/sys/errno.h#L69 :
> #define EBUSY 16 /* Device busy */
2. Error messages will be localized
For example:
| Language | "Resource busy"
| -------- | ---------------
| Chinese | 资源忙
| Chinese | 資源忙碌中
| Japanese | リソースが使用中です
| Russian | Ресурс занят
3. Conculsion
We should not test the content of the error message. Just testing the
exit code "16" is sufficient and reliable.1 parent dd7b7f7 commit 29e0c5c
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments