diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-04-29 21:13:14 +0000 |
commit | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch) | |
tree | 40b1cb534496a7f1ca0f5c314a523c69f1fee464 /fs/proc/fd.c | |
parent | 7206675c40394c78a90e74812bbdbf8cf3cca1be (diff) |
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'fs/proc/fd.c')
-rw-r--r-- | fs/proc/fd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 8d4201844..e5e4fd9a8 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -21,7 +21,7 @@ static struct file_operations proc_fd_operations = { NULL, /* read - bad */ NULL, /* write - bad */ proc_readfd, /* readdir */ - NULL, /* select - default */ + NULL, /* poll - default */ NULL, /* ioctl - default */ NULL, /* mmap */ NULL, /* no special open code */ @@ -106,7 +106,13 @@ static int proc_lookupfd(struct inode * dir, const char * name, int len, if (!pid || i >= NR_TASKS) return -ENOENT; - if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode) + /* + * File handle is invalid if it is out of range, if the process + * has no files (Zombie) if the file is closed, or if its inode + * is NULL + */ + + if (fd >= NR_OPEN || !p->files || !p->files->fd[fd] || !p->files->fd[fd]->f_inode) return -ENOENT; ino = (pid << 16) + (PROC_PID_FD_DIR << 8) + fd; |