Changeset View
Changeset View
Standalone View
Standalone View
bin/pwd/pwd.c
| Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | main(int argc, char *argv[]) | ||||
| * If we're trying to find the logical current directory and that | * If we're trying to find the logical current directory and that | ||||
| * fails, behave as if -P was specified. | * fails, behave as if -P was specified. | ||||
| */ | */ | ||||
| if ((logical && (pwd = getcwd_logical()) != NULL) || | if ((logical && (pwd = getcwd_logical()) != NULL) || | ||||
| (pwd = getcwd_physical()) != NULL) | (pwd = getcwd_physical()) != NULL) | ||||
| printf("%s\n", pwd); | printf("%s\n", pwd); | ||||
| else | else | ||||
| err(1, "."); | err(1, "."); | ||||
| if (fflush(stdout) != 0) | |||||
| err(1, "stdout"); | |||||
| exit(0); | exit(0); | ||||
| } | } | ||||