mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 06:31:58 +00:00
FreeBSD fix and applied riccardo's patch
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
extern struct uwsgi_server uwsgi;
|
||||
|
||||
static void spooler_readdir(char *);
|
||||
#ifdef __linux__
|
||||
static void spooler_scandir(char *);
|
||||
#endif
|
||||
void spooler_manage_task(char *, char *);
|
||||
|
||||
pid_t spooler_start() {
|
||||
@@ -163,7 +165,9 @@ void spooler() {
|
||||
}
|
||||
|
||||
if (uwsgi.spooler_ordered) {
|
||||
#ifdef __linux__
|
||||
spooler_scandir(uwsgi.spool_dir);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
spooler_readdir(uwsgi.spool_dir);
|
||||
@@ -174,6 +178,7 @@ void spooler() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
static void spooler_scandir(char *dir) {
|
||||
|
||||
struct dirent **tasklist;
|
||||
@@ -192,6 +197,7 @@ static void spooler_scandir(char *dir) {
|
||||
|
||||
free(tasklist);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void spooler_readdir(char *dir) {
|
||||
@@ -226,6 +232,7 @@ void spooler_manage_task(char *dir, char *task) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
if (S_ISDIR(sf_lstat.st_mode) && uwsgi.spooler_ordered) {
|
||||
if (chdir(task)) {
|
||||
uwsgi_error("chdir()");
|
||||
@@ -237,6 +244,7 @@ void spooler_manage_task(char *dir, char *task) {
|
||||
chdir(dir);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (!S_ISREG(sf_lstat.st_mode)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2401,16 +2401,16 @@ int *uwsgi_attach_fd(int fd, int count, char *code, size_t code_len) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((size_t) (cmsg->cmsg_len - ((char *)CMSG_DATA(cmsg)- (char *)cmsg)) > (size_t) (sizeof(int) * (count + 1))) {
|
||||
uwsgi_log("not enough space for sockets data, consider increasing it\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = uwsgi_malloc(sizeof(int) * (count + 1));
|
||||
for(i=0;i<count+1;i++) {
|
||||
ret[i] = -1;
|
||||
}
|
||||
|
||||
if ((size_t) (cmsg->cmsg_len - ((char *)CMSG_DATA(cmsg)- (char *)cmsg)) > (size_t) (sizeof(int) * (count + 1))) {
|
||||
uwsgi_log("not enough space for sockets data, consider increasing it\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(ret, CMSG_DATA(cmsg), cmsg->cmsg_len - ((char *)CMSG_DATA(cmsg)- (char *)cmsg));
|
||||
|
||||
free(msg_control);
|
||||
|
||||
@@ -116,7 +116,6 @@
|
||||
#define __USE_GNU
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
#include <sched.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <linux/limits.h>
|
||||
@@ -131,6 +130,8 @@ extern int pivot_root(const char * new_root, const char * put_old);
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#ifdef UWSGI_SCTP
|
||||
#include <netinet/sctp.h>
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user