aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftee/main.c
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-06-16 16:02:43 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-06-28 03:43:51 -0300
commit33fb2bed58e9f4dfadd2f69f90e474fd46099419 (patch)
tree5468ece6e39ed9a8f7be91834a45a106d6357a74 /src/ftee/main.c
parentRELNOTES: add build items (diff)
downloadfirejail-33fb2bed58e9f4dfadd2f69f90e474fd46099419.tar.gz
firejail-33fb2bed58e9f4dfadd2f69f90e474fd46099419.tar.zst
firejail-33fb2bed58e9f4dfadd2f69f90e474fd46099419.zip
Deduplicate calls similar to errExit
Use errExit in every place that uses __FILE__ and __LINE__ manually. Note: This currently only happens in the duplicated `is_dir` function.
Diffstat (limited to 'src/ftee/main.c')
-rw-r--r--src/ftee/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ftee/main.c b/src/ftee/main.c
index a34a76b26..20e25c202 100644
--- a/src/ftee/main.c
+++ b/src/ftee/main.c
@@ -148,10 +148,8 @@ static int is_dir(const char *fname) {
148 rv = stat(fname, &s); 148 rv = stat(fname, &s);
149 else { 149 else {
150 char *tmp; 150 char *tmp;
151 if (asprintf(&tmp, "%s/", fname) == -1) { 151 if (asprintf(&tmp, "%s/", fname) == -1)
152 fprintf(stderr, "Error: cannot allocate memory, %s:%d\n", __FILE__, __LINE__); 152 errExit("asprintf");
153 exit(1);
154 }
155 rv = stat(tmp, &s); 153 rv = stat(tmp, &s);
156 free(tmp); 154 free(tmp);
157 } 155 }