Commit 186ce9b6 authored by Jeff Dike's avatar Jeff Dike

Forward ported a bunch of fixes from 2.4.

parent ac249f01
...@@ -11,8 +11,6 @@ include/linux/version.h: arch/$(ARCH)/Makefile ...@@ -11,8 +11,6 @@ include/linux/version.h: arch/$(ARCH)/Makefile
# EXTRAVERSION... # EXTRAVERSION...
MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) MODLIB := $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
MAKEBOOT = $(MAKE) -C $(ARCH_DIR)/boot
ifeq ($(CONFIG_DEBUGSYM),y) ifeq ($(CONFIG_DEBUGSYM),y)
DEBUG = -g DEBUG = -g
CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS)) CFLAGS := $(subst -fomit-frame-pointer,,$(CFLAGS))
...@@ -106,11 +104,9 @@ archclean: sysclean ...@@ -106,11 +104,9 @@ archclean: sysclean
find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
-o -name '*.gcov' \) -type f -print | xargs rm -f -o -name '*.gcov' \) -type f -print | xargs rm -f
rm -f linux x.i gmon.out $(ARCH_DIR)/link.ld $(GEN_HEADERS) rm -f linux x.i gmon.out $(ARCH_DIR)/link.ld $(GEN_HEADERS)
@$(MAKEBOOT) clean
archdep: archdep:
for d in $(ARCH_SUBDIRS); do $(MAKE) -C $$d fastdep; done for d in $(ARCH_SUBDIRS); do $(MAKE) -C $$d fastdep; done
@$(MAKEBOOT) dep
$(SYMLINK_HEADERS): $(SYMLINK_HEADERS):
cd $(TOPDIR)/$(dir $@) ; \ cd $(TOPDIR)/$(dir $@) ; \
......
...@@ -32,8 +32,8 @@ struct port_list { ...@@ -32,8 +32,8 @@ struct port_list {
struct port_dev { struct port_dev {
struct port_list *port; struct port_list *port;
int fd; int fd;
int helper_pid; int helper_pid;
int telnetd_pid; int telnetd_pid;
}; };
struct connection { struct connection {
...@@ -50,7 +50,7 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs) ...@@ -50,7 +50,7 @@ static void pipe_interrupt(int irq, void *data, struct pt_regs *regs)
struct connection *conn = data; struct connection *conn = data;
int fd; int fd;
fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); fd = os_rcv_fd(conn->socket[0], &conn->helper_pid);
if(fd < 0){ if(fd < 0){
if(fd == -EAGAIN) if(fd == -EAGAIN)
return; return;
...@@ -191,9 +191,9 @@ void *port_data(int port_num) ...@@ -191,9 +191,9 @@ void *port_data(int port_num)
goto out; goto out;
} }
*dev = ((struct port_dev) { port : port, *dev = ((struct port_dev) { port : port,
fd : -1, fd : -1,
helper_pid : -1 }); helper_pid : -1 });
goto out; goto out;
out_free: out_free:
...@@ -275,8 +275,8 @@ void port_kern_free(void *d) ...@@ -275,8 +275,8 @@ void port_kern_free(void *d)
{ {
struct port_dev *dev = d; struct port_dev *dev = d;
if(dev->helper_pid != -1) os_kill_process(dev->telnetd_pid); if(dev->helper_pid != -1) os_kill_process(dev->telnetd_pid);
if(dev->telnetd_pid != -1) os_kill_process(dev->telnetd_pid); if(dev->telnetd_pid != -1) os_kill_process(dev->telnetd_pid);
kfree(dev); kfree(dev);
} }
......
...@@ -129,42 +129,6 @@ int port_listen_fd(int port) ...@@ -129,42 +129,6 @@ int port_listen_fd(int port)
return(err); return(err);
} }
int port_rcv_fd(int fd)
{
int new, n;
char buf[CMSG_SPACE(sizeof(new))];
struct msghdr msg;
struct cmsghdr *cmsg;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = NULL;
msg.msg_iovlen = 0;
msg.msg_control = buf;
msg.msg_controllen = sizeof(buf);
msg.msg_flags = 0;
n = recvmsg(fd, &msg, 0);
if(n < 0){
printk("rcv_fd : recvmsg failed - errno = %d\n", errno);
return(-1);
}
cmsg = CMSG_FIRSTHDR(&msg);
if(cmsg == NULL){
printk("rcv_fd didn't receive anything, error = %d\n", errno);
return(-1);
}
if((cmsg->cmsg_level != SOL_SOCKET) ||
(cmsg->cmsg_type != SCM_RIGHTS)){
printk("rcv_fd didn't receive a descriptor\n");
return(-1);
}
new = ((int *) CMSG_DATA(cmsg))[0];
return(new);
}
struct port_pre_exec_data { struct port_pre_exec_data {
int sock_fd; int sock_fd;
int pipe_fd; int pipe_fd;
......
...@@ -473,6 +473,8 @@ void do_io(struct io_thread_req *req) ...@@ -473,6 +473,8 @@ void do_io(struct io_thread_req *req)
&req->sector_mask) == bit)) &req->sector_mask) == bit))
end++; end++;
if(end != nsectors)
printk("end != nsectors\n");
off = req->offset + req->offsets[bit] + off = req->offset + req->offsets[bit] +
start * req->sectorsize; start * req->sectorsize;
len = (end - start) * req->sectorsize; len = (end - start) * req->sectorsize;
......
...@@ -22,11 +22,13 @@ struct xterm_wait { ...@@ -22,11 +22,13 @@ struct xterm_wait {
static void xterm_interrupt(int irq, void *data, struct pt_regs *regs) static void xterm_interrupt(int irq, void *data, struct pt_regs *regs)
{ {
struct xterm_wait *xterm = data; struct xterm_wait *xterm = data;
int fd;
xterm->new_fd = os_rcv_fd(xterm->fd, &xterm->pid); fd = os_rcv_fd(xterm->fd, &xterm->pid);
if(xterm->new_fd == -EAGAIN) if(fd == -EAGAIN)
return; return;
xterm->new_fd = fd;
up(&xterm->sem); up(&xterm->sem);
} }
......
...@@ -338,6 +338,7 @@ void reactivate_fd(int fd, int irqnum) ...@@ -338,6 +338,7 @@ void reactivate_fd(int fd, int irqnum)
irq_unlock(flags); irq_unlock(flags);
return; return;
} }
pollfds[i].fd = irq->fd; pollfds[i].fd = irq->fd;
irq_unlock(flags); irq_unlock(flags);
......
/*
* Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com)
* Licensed under the GPL
*/
#include "asm/processor.h"
struct cpuinfo_um boot_cpu_data = { loops_per_jiffy : 0,
ipi_pipe : { -1, -1 } };
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#include <sys/param.h> #include <sys/param.h>
#include "init.h" #include "init.h"
char *tempdir = NULL; /* Modified from create_mem_file and start_debugger */
static char *tempdir = NULL;
static void __init find_tempdir(void) static void __init find_tempdir(void)
{ {
......
...@@ -186,6 +186,7 @@ int os_pipe(int *fds, int stream, int close_on_exec) ...@@ -186,6 +186,7 @@ int os_pipe(int *fds, int stream, int close_on_exec)
int os_set_fd_async(int fd, int owner) int os_set_fd_async(int fd, int owner)
{ {
/* XXX This should do F_GETFL first */
if(fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK) < 0){ if(fcntl(fd, F_SETFL, O_ASYNC | O_NONBLOCK) < 0){
printk("os_set_fd_async : failed to set O_ASYNC and " printk("os_set_fd_async : failed to set O_ASYNC and "
"O_NONBLOCK on fd # %d, errno = %d\n", fd, errno); "O_NONBLOCK on fd # %d, errno = %d\n", fd, errno);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment