Replace unsetenv() and setenv() with older putenv().
Solaris 8 doesn't have the newer unsetenv() and setenv() functions, so replace them with putenv(). The one use of unsetenv() in fsck-cache.c now sets GIT_ALTERNATE_OBJECT_ DIRECTORIES to the empty string. Every place that var is used, NULLs are also replaced with empty strings, so it's ok. Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
This commit is contained in:
@ -454,7 +454,7 @@ int main(int argc, char **argv)
|
|||||||
if (standalone && check_full)
|
if (standalone && check_full)
|
||||||
die("Only one of --standalone or --full can be used.");
|
die("Only one of --standalone or --full can be used.");
|
||||||
if (standalone)
|
if (standalone)
|
||||||
unsetenv("GIT_ALTERNATE_OBJECT_DIRECTORIES");
|
putenv("GIT_ALTERNATE_OBJECT_DIRECTORIES=");
|
||||||
|
|
||||||
fsck_head_link();
|
fsck_head_link();
|
||||||
fsck_object_dir(get_object_directory());
|
fsck_object_dir(get_object_directory());
|
||||||
|
@ -269,7 +269,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* If we have a ".git" directory, chdir to it */
|
/* If we have a ".git" directory, chdir to it */
|
||||||
chdir(".git");
|
chdir(".git");
|
||||||
setenv("GIT_DIR", ".", 1);
|
putenv("GIT_DIR=.");
|
||||||
|
|
||||||
if (access("objects", X_OK) < 0 || access("refs/heads", X_OK) < 0)
|
if (access("objects", X_OK) < 0 || access("refs/heads", X_OK) < 0)
|
||||||
die("%s doesn't appear to be a git directory", dir);
|
die("%s doesn't appear to be a git directory", dir);
|
||||||
|
@ -179,7 +179,7 @@ int main(int argc, char **argv)
|
|||||||
chdir(".git");
|
chdir(".git");
|
||||||
if (access("objects", X_OK) || access("refs", X_OK))
|
if (access("objects", X_OK) || access("refs", X_OK))
|
||||||
die("git-upload-pack: %s doesn't seem to be a git archive", dir);
|
die("git-upload-pack: %s doesn't seem to be a git archive", dir);
|
||||||
setenv("GIT_DIR", ".", 1);
|
putenv("GIT_DIR=.");
|
||||||
upload_pack();
|
upload_pack();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user