diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-01-27 15:54:04 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-01-27 15:54:04 +0100 |
commit | 7eb994a38ee5b34fc2a1221a9ecb20d9183a56e9 (patch) | |
tree | a623ca51e51cd25d5666a883cdef13f4c4779843 | |
parent | 2181f1e16d2c235ffb117e3d0f7c73589b82197d (diff) | |
download | rvnit-7eb994a38ee5b34fc2a1221a9ecb20d9183a56e9.tar.gz rvnit-7eb994a38ee5b34fc2a1221a9ecb20d9183a56e9.tar.xz rvnit-7eb994a38ee5b34fc2a1221a9ecb20d9183a56e9.zip |
default to /etc/rvnit
-rw-r--r-- | rvnit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/rvnit.c b/rvnit.c index 933be5f..26b1446 100644 --- a/rvnit.c +++ b/rvnit.c @@ -621,12 +621,14 @@ own_console() int main(int argc, char *argv[]) { - if (argc < 2) { - dprintf(2, "Usage: rvnit DIR\n"); - exit(2); - } + if (argc < 1) + return 111; + + const char *dir = "/etc/rvnit"; + if (argc == 2) + dir = argv[1]; - if (chdir(argv[1]) < 0) { + if (chdir(dir) < 0) { perror("chdir"); return 111; } |