diff --git a/libogc/sha.c b/libogc/sha.c index 813874d1..7b689db5 100644 --- a/libogc/sha.c +++ b/libogc/sha.c @@ -96,10 +96,8 @@ static s32 SHA_ExecuteCommand(const ShaCommand command, const sha_context* conte s32 SHA_Init(void) { - if (__sha_fd >= 0) - return -1; - - __sha_fd = IOS_Open("/dev/sha", 0); + if (__sha_fd < 0) + __sha_fd = IOS_Open("/dev/sha", 0); if (__sha_fd < 0) return __sha_fd; @@ -113,7 +111,7 @@ s32 SHA_Init(void) return __sha_hid; } - return 0; + return IPC_OK; } s32 SHA_Close(void) @@ -181,4 +179,4 @@ s32 SHA_Calculate(const void* data, const u32 data_size, void* message_digest) return SHA_Finalize(&context, data, data_size, message_digest); } -#endif \ No newline at end of file +#endif