applied riccardo's patch [2]

This commit is contained in:
roberto@oneiric64
2011-11-26 08:10:29 +01:00
parent 0d8690091b
commit 9530c8ffe0
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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)
+5 -2
View File
@@ -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;
}