Added smooth pass option, improved texture lookup performance, fixes #10 (and fixed issues with config copying)

This commit is contained in:
Jarcode
2018-02-03 11:08:28 -08:00
parent dbcecc9def
commit 522d022b70
11 changed files with 240 additions and 99 deletions

View File

@@ -103,7 +103,7 @@ static void copy_cfg(const char* path, const char* dest, bool verbose) {
fprintf(stderr, "failed to open (source) '%s': %s\n", p, strerror(errno));
goto cleanup;
}
if ((dest = open(f, O_WRONLY | O_CREAT, ACCESSPERMS)) < 0) {
if ((dest = open(f, O_TRUNC | O_WRONLY | O_CREAT, ACCESSPERMS)) < 0) {
fprintf(stderr, "failed to open (destination) '%s': %s\n", f, strerror(errno));
goto cleanup;
}
@@ -126,7 +126,7 @@ static void copy_cfg(const char* path, const char* dest, bool verbose) {
}
break;
case 2:
if (symlink(p, f))
if (symlink(p, f) && errno != EEXIST)
fprintf(stderr, "failed to symlink '%s' -> '%s': %s\n", p, f, strerror(errno));
else if (verbose)
printf("symlink '%s' -> '%s'\n", p, f);