Skip to content

Commit

Permalink
Updated code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Mar 29, 2023
1 parent be1d51a commit 7a0172d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/goaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ verify_inode (FILE * fp, GLog * glog) {
struct stat fdstat;

if (stat (glog->props.filename, &fdstat) == -1)
FATAL ("Unable to stat the specified log file '%s'. %s", glog->props.filename, strerror (errno));
FATAL ("Unable to stat the specified log file '%s'. %s", glog->props.filename,
strerror (errno));

glog->props.size = fdstat.st_size;
/* Either the log got smaller, probably was truncated so start reading from 0
Expand Down Expand Up @@ -842,7 +843,8 @@ perform_tail_follow (GLog * glog) {
return 0;

if (!(fp = fopen (glog->props.filename, "r")))
FATAL ("Unable to read the specified log file '%s'. %s", glog->props.filename, strerror (errno));
FATAL ("Unable to read the specified log file '%s'. %s", glog->props.filename,
strerror (errno));

verify_inode (fp, glog);

Expand Down
9 changes: 6 additions & 3 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ set_glog (Logs * logs, const char *filename) {
logs->size = newlen;
}

fn = xstrdup (filename); /* ensure fn is a string */
fn = xstrdup (filename); /* ensure fn is a string */
glog = logs->glog;
glog[logs->idx].errors = xcalloc (MAX_LOG_ERRORS, sizeof (char *));
glog[logs->idx].props.filename = xstrdup (fn);
glog[logs->idx].props.fname = xstrdup (basename (fn));

if (!glog->pipe && conf.fname_as_vhost) {
if (!(fvh = regex_extract_string (glog[logs->idx].props.fname, conf.fname_as_vhost, 1, &err)))
if (!
(fvh =
regex_extract_string (glog[logs->idx].props.fname, conf.fname_as_vhost, 1, &err)))
FATAL ("%s %s[%s]", err, glog[logs->idx].props.fname, conf.fname_as_vhost);
glog[logs->idx].fname_as_vhost = fvh;
}
Expand Down Expand Up @@ -2144,7 +2146,8 @@ read_log (GLog * glog, int dry_run) {

/* make sure we can open the log (if not reading from stdin) */
if (!piping && (fp = fopen (glog->props.filename, "r")) == NULL)
FATAL ("Unable to open the specified log file '%s'. %s", glog->props.filename, strerror (errno));
FATAL ("Unable to open the specified log file '%s'. %s", glog->props.filename,
strerror (errno));

/* grab the inode of the file being parsed */
if (!piping && stat (glog->props.filename, &fdstat) == 0) {
Expand Down

0 comments on commit 7a0172d

Please sign in to comment.