1761205107

This commit is contained in:
2025-10-23 01:38:27 -06:00
parent 77b5c2dba1
commit 7407cdb77c
2 changed files with 10 additions and 7 deletions
+9 -7
View File
@@ -3,13 +3,15 @@
int main(void) {
int rc = system("whoami");
if (rc == -1) {
perror("system");
return 1;
}
printf("%d", rc);
// if (rc == -1) {
// perror("system");
// return 1;
// }
// If you need the command exit code:
if (WIFEXITED(rc)) {
printf("exit status: %d\n", WEXITSTATUS(rc));
}
// if (WIFEXITED(rc)) {
// only show return status during debug
// printf("exit status: %d\n", WEXITSTATUS(rc));
// }
return 0;
}