diff options
Diffstat (limited to 'src/paths.c')
| -rw-r--r-- | src/paths.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/paths.c b/src/paths.c index b8d7cd5..d3108b8 100644 --- a/src/paths.c +++ b/src/paths.c @@ -1,4 +1,26 @@ +/* + + pow! - the pow!erful package manager + + Copyright (C) 2026 forever2k38 + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +*/ + #include "paths.h" +#include "log.h" #include "errno.h" #include "stdio.h" @@ -7,12 +29,12 @@ #include "sys/stat.h" #include "unistd.h" -char template[] = "/tmp/pow/XXXXXX"; +char template[] = "/var/tmp/pow/XXXXXX"; int pow_create_dir_for_package(char **path) { - if (mkdir("/tmp/pow", 0700)) { + if (mkdir("/var/tmp/pow", 0700)) { if (errno != EEXIST) { - printf("failed to create temp dir\n"); + pow_log_error("failed to create temp dir\n"); return 1; } @@ -27,7 +49,7 @@ int pow_create_dir_for_package(char **path) { strcpy(new_path, template); if (!mkdtemp(new_path)) { - printf("failed to make dir\n"); + pow_log_error("failed to make dir\n"); free(new_path); return 1; |
