Skip to content

Commit a4aebcc

Browse files
committed
skip key on error
1 parent 91180f1 commit a4aebcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

smc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ kern_return_t SMCPrintAll(void)
241241

242242
_ultostr(key, outputStructure.key);
243243

244-
SMCReadKey(key, &val);
244+
result = SMCReadKey(key, &val);
245+
if (result != kIOReturnSuccess)
246+
continue;
247+
245248
char* txt = SMCNormalizeText(val);
246249
printf("key = %s type = %s value = %s\n", key, val.dataType, txt);
247250
}

0 commit comments

Comments
 (0)