summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4696cb9)
raw | patch | inline | side by side (parent: 4696cb9)
author | Zach Welch <zw@superlucidity.net> | |
Wed, 20 Apr 2005 04:48:15 +0000 (21:48 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Wed, 20 Apr 2005 04:48:15 +0000 (21:48 -0700) |
Normalize init-db environment variable handling, allowing the creation
of object directories with something other than DEFAULT_DB_ENVIRONMENT.
Signed-Off-By: Zach Welch <zw@superlucidity.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
of object directories with something other than DEFAULT_DB_ENVIRONMENT.
Signed-Off-By: Zach Welch <zw@superlucidity.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
init-db.c | patch | blob | history |
diff --git a/init-db.c b/init-db.c
index bfbe1eb1b6a3daa6e462046338a62c954ace1717..7078cf72c2875490c4262989d04c0ce032484068 100644 (file)
--- a/init-db.c
+++ b/init-db.c
}
sha1_dir = getenv(DB_ENVIRONMENT);
- if (sha1_dir) {
- struct stat st;
- if (!stat(sha1_dir, &st) && S_ISDIR(st.st_mode))
- return 0;
- fprintf(stderr, "DB_ENVIRONMENT set to bad directory %s: ", sha1_dir);
+ if (!sha1_dir) {
+ sha1_dir = DEFAULT_DB_ENVIRONMENT;
+ fprintf(stderr, "defaulting to local storage area\n");
}
-
- sha1_dir = DEFAULT_DB_ENVIRONMENT;
- fprintf(stderr, "defaulting to private storage area\n");
len = strlen(sha1_dir);
if (mkdir(sha1_dir, 0755) < 0) {
if (errno != EEXIST) {