mirror of
https://github.com/allinurl/goaccess.git
synced 2025-06-19 06:55:32 -04:00
Added missing header for struct stat.
This commit is contained in:
parent
869c0310bd
commit
b58b43edef
@ -39,6 +39,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBGEOIP
|
#ifdef HAVE_LIBGEOIP
|
||||||
#include <GeoIP.h>
|
#include <GeoIP.h>
|
||||||
@ -977,10 +978,8 @@ parse_long_opt (const char *name, const char *oarg) {
|
|||||||
if (!strcmp("db-path", name)) {
|
if (!strcmp("db-path", name)) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
// Check if the directory exists and is accessible
|
// Check if the directory exists and is accessible
|
||||||
if (stat(oarg, &st) != 0 || !S_ISDIR(st.st_mode)) {
|
if (stat(oarg, &st) != 0 || !S_ISDIR(st.st_mode))
|
||||||
perror("Database path does not exist or is not a directory");
|
FATAL("Database path does not exist or is not a directory");
|
||||||
return -1; // Return error or handle as appropriate
|
|
||||||
}
|
|
||||||
conf.db_path = oarg;
|
conf.db_path = oarg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user