Skip to content

Commit

Permalink
Skip to the end of the file before reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Aug 26, 2024
1 parent 5056e00 commit f7f5bdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wpiutil/src/main/native/cpp/FileLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ FileLogger::FileLogger(std::string_view file,
char buf[4000];
struct inotify_event ev;
int len = 0;
lseek(m_fileHandle, 0, SEEK_END);
while ((len = read(m_inotifyHandle, &ev, sizeof(ev))) > 0) {
int bufLen = 0;
if ((bufLen = read(m_fileHandle, buf, sizeof(buf)) > 0)) {
Expand Down

0 comments on commit f7f5bdc

Please sign in to comment.