You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-devel/distcc/files/distcc-create-dir.patch

57 lines
1.4 KiB

* local directory is at mbp@sourcefrog.net--2004/distcc--devel--2--patch-183
* comparing to mbp@sourcefrog.net--2004/distcc--devel--2--patch-183
M ./src/tempfile.c
* modified files
--- orig/src/tempfile.c
+++ mod/src/tempfile.c
@@ -145,7 +145,7 @@
int dcc_get_top_dir(char **path_ret)
{
char *env;
- static char *cached;
+ static char *cached = NULL;
int ret;
if (cached) {
@@ -154,22 +154,23 @@
}
if ((env = getenv("DISTCC_DIR"))) {
- if ((cached = strdup(env)) == NULL) {
+
+ if ((cached = strdup(env)) == NULL)
return EXIT_OUT_OF_MEMORY;
- } else {
+ else
*path_ret = cached;
- return 0;
- }
- }
- if ((env = getenv("HOME")) == NULL) {
- rs_log_warning("HOME is not set; can't find distcc directory");
- return EXIT_BAD_ARGUMENTS;
- }
+ } else {
- if (asprintf(path_ret, "%s/.distcc", env) == -1) {
- rs_log_error("asprintf failed");
- return EXIT_OUT_OF_MEMORY;
+ if ((env = getenv("HOME")) == NULL) {
+ rs_log_warning("HOME is not set; can't find distcc directory");
+ return EXIT_BAD_ARGUMENTS;
+ }
+
+ if (asprintf(path_ret, "%s/.distcc", env) == -1) {
+ rs_log_error("asprintf failed");
+ return EXIT_OUT_OF_MEMORY;
+ }
}
ret = dcc_mkdir(*path_ret);