use stat() instead of lstat() (#15287)
Costa Tsaousis committed
Jun 29, 2023 at 18:48 UTC
fd5dcfd1210a1537a563f20a027bd3cf917e2814
2 files changed
+6
-6
database/engine/rrdengineapi.c
+1
-1
@@ -1085,7 +1085,7 @@ static void rrdeng_populate_mrg(struct rrdengine_instance *ctx) {
1085
if(cpus < 1)
1086
cpus = 1;
1087
1088
- info("DBENGINE: populating retention to MRG from %zu journal files of tier %d, using %zu threads...", datafiles, ctx->config.tier, cpus);
1088
+ info("DBENGINE: populating retention to MRG from %zu journal files of tier %d, using %zd threads...", datafiles, ctx->config.tier, cpus);
1089
1090
if(datafiles > 2) {
1091
struct rrdengine_datafile *datafile;
web/server/web_client.c
+5
-5
@@ -430,24 +430,24 @@ static bool find_filename_to_serve(const char *filename, char *dst, size_t dst_l
430
fallback = 3;
431
}
432
433
- if (lstat(dst, statbuf) != 0) {
433
+ if (stat(dst, statbuf) != 0) {
434
if(fallback == 1) {
435
snprintfz(dst, dst_len, "%s/%s", netdata_configured_web_dir, filename);
436
- if (lstat(dst, statbuf) != 0)
436
+ if (stat(dst, statbuf) != 0)
437
return false;
438
}
439
else if(fallback == 2) {
440
if(filename && *filename)
441
web_client_flag_set(w, WEB_CLIENT_FLAG_PATH_HAS_TRAILING_SLASH);
442
snprintfz(dst, dst_len, "%s/v%d", netdata_configured_web_dir, d_version);
443
- if (lstat(dst, statbuf) != 0)
443
+ if (stat(dst, statbuf) != 0)
444
return false;
445
}
446
else if(fallback == 3) {
447
if(filename && *filename)
448
web_client_flag_set(w, WEB_CLIENT_FLAG_PATH_HAS_TRAILING_SLASH);
449
snprintfz(dst, dst_len, "%s", netdata_configured_web_dir);
450
- if (lstat(dst, statbuf) != 0)
450
+ if (stat(dst, statbuf) != 0)
451
return false;
452
}
453
else
@@ -461,7 +461,7 @@ static bool find_filename_to_serve(const char *filename, char *dst, size_t dst_l
461
462
strncpyz(&dst[len], "/index.html", dst_len - len);
463
464
- if (lstat(dst, statbuf) != 0)
464
+ if (stat(dst, statbuf) != 0)
465
return false;
466
467
*is_dir = true;