Return mount's actual error codes instead of obfuscating them.
In addition to being unnecessary, this obfuscation does not account for
the fact that the codes can be combined using a bitwise or.
This is part of the reason we were unable to identify the actual problem
with the series of bugs involving the error "SystemError: (2, None)"
during F11, F12, and perhaps after that.
-/* Returns true iff it is possible that the mount command that have returned
- * 'errno' might succeed at a later time (think e.g. not yet initialized USB
- * device, etc.) */
+/* Returns true iff it is possible that a failed mount command might
+ * succeed at a later time (think e.g. not yet initialized USB device,
+ * etc.) */
int mountMightSucceedLater(int mountRc)
{
- int rc;
- switch (mountRc) {
- case IMOUNT_ERR_MOUNTFAILURE:
- rc = 1;
- break;
- default:
- rc = 0;
- }
- return rc;
+ /* 32 is the mount exit code for "mount failure" */
+ if (mountRc > 0 && mountRc & 0x20)
+ return 1;
+ else
+ return 0;
}