mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
applied riccardo's patch [2]
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ struct uwsgi_subscribe_node *uwsgi_get_subscribe_node(struct uwsgi_subscribe_slo
|
||||
current_slot->hits++;
|
||||
time_t current = time(NULL);
|
||||
struct uwsgi_subscribe_node *node = current_slot->nodes;
|
||||
while(current_slot && node) {
|
||||
while(node) {
|
||||
// is the node alive ?
|
||||
if (current - node->last_check > uwsgi.subscription_tolerance) {
|
||||
if (node->death_mark == 0)
|
||||
|
||||
@@ -1840,6 +1840,8 @@ char *uwsgi_read_fd(int fd, int *size, int add_zero) {
|
||||
char *uwsgi_simple_file_read(char *filename) {
|
||||
|
||||
struct stat sb;
|
||||
char *buffer;
|
||||
ssize_t len;
|
||||
int fd = open(filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
uwsgi_error_open(filename);
|
||||
@@ -1852,11 +1854,12 @@ char *uwsgi_simple_file_read(char *filename) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
char *buffer = uwsgi_malloc(sb.st_size+1);
|
||||
buffer = uwsgi_malloc(sb.st_size+1);
|
||||
|
||||
ssize_t len = read(fd, buffer, sb.st_size);
|
||||
len = read(fd, buffer, sb.st_size);
|
||||
if (len != sb.st_size) {
|
||||
uwsgi_error("read()");
|
||||
free(buffer);
|
||||
close(fd);
|
||||
goto end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user