Browse Source

* logfile.[ch]: add state flag to f2b_logfile_t struct

master
Alex 'AdUser' Z 8 years ago
parent
commit
48c4af7f89
  1. 2
      src/logfile.c
  2. 1
      src/logfile.h

2
src/logfile.c

@ -33,6 +33,7 @@ f2b_logfile_open(f2b_logfile_t *file, const char *path) {
memcpy(&file->st, &st, sizeof(st));
strlcpy(file->path, buf, sizeof(file->path));
file->opened = true;
return true;
}
@ -41,6 +42,7 @@ void
f2b_logfile_close(const f2b_logfile_t *file) {
assert(file != NULL);
fclose(file->fd);
file->opened = false;
}
bool

1
src/logfile.h

@ -9,6 +9,7 @@
typedef struct f2b_logfile_t {
struct f2b_logfile_t *next;
bool opened;
char path[PATH_MAX];
FILE *fd;
struct stat st;

Loading…
Cancel
Save