log-handler.c (6498f9fa9792ef0c14dab4aca3d38a674f6402cd) log-handler.c (366651d9ef0e03f97b1e1d2b6188f2b452044d1c)
1/**
2 * Copyright © 2016 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

--- 122 unchanged lines hidden (view full) ---

131{
132 off_t pos;
133
134 lh->fd = open(lh->log_filename, O_WRONLY | O_CREAT | O_APPEND, 0644);
135 if (lh->fd < 0) {
136 warn("Can't open log buffer file %s", lh->log_filename);
137 return -1;
138 }
1/**
2 * Copyright © 2016 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0

--- 122 unchanged lines hidden (view full) ---

131{
132 off_t pos;
133
134 lh->fd = open(lh->log_filename, O_WRONLY | O_CREAT | O_APPEND, 0644);
135 if (lh->fd < 0) {
136 warn("Can't open log buffer file %s", lh->log_filename);
137 return -1;
138 }
139 pos = lseek(lh->fd, 0, SEEK_CUR);
139 pos = lseek(lh->fd, 0, SEEK_END);
140 if (pos < 0) {
141 warn("Can't query log position for file %s", lh->log_filename);
142 close(lh->fd);
143 return -1;
144 }
145 lh->size = pos;
146 if ((size_t)pos >= lh->maxsize) {
147 return log_trim(lh);

--- 87 unchanged lines hidden ---
140 if (pos < 0) {
141 warn("Can't query log position for file %s", lh->log_filename);
142 close(lh->fd);
143 return -1;
144 }
145 lh->size = pos;
146 if ((size_t)pos >= lh->maxsize) {
147 return log_trim(lh);

--- 87 unchanged lines hidden ---