git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
s390
/
char
/
fs3270.c
diff --git
a/drivers/s390/char/fs3270.c
b/drivers/s390/char/fs3270.c
index
ef004d0
..
0893d30
100644
(file)
--- a/
drivers/s390/char/fs3270.c
+++ b/
drivers/s390/char/fs3270.c
@@
-17,7
+17,6
@@
#include <asm/ccwdev.h>
#include <asm/cio.h>
#include <asm/ccwdev.h>
#include <asm/cio.h>
-#include <asm/cpcmd.h>
#include <asm/ebcdic.h>
#include <asm/idals.h>
#include <asm/ebcdic.h>
#include <asm/idals.h>
@@
-28,7
+27,7
@@
struct raw3270_fn fs3270_fn;
struct fs3270 {
struct raw3270_view view;
struct fs3270 {
struct raw3270_view view;
-
pid_t fs_pid;
/* Pid of controlling program. */
+
struct pid *fs_pid;
/* Pid of controlling program. */
int read_command; /* ccw command to use for reads. */
int write_command; /* ccw command to use for writes. */
int attention; /* Got attention. */
int read_command; /* ccw command to use for reads. */
int write_command; /* ccw command to use for writes. */
int attention; /* Got attention. */
@@
-103,7
+102,7
@@
fs3270_restore_callback(struct raw3270_request *rq, void *data)
fp = (struct fs3270 *) rq->view;
if (rq->rc != 0 || rq->rescnt != 0) {
if (fp->fs_pid)
fp = (struct fs3270 *) rq->view;
if (rq->rc != 0 || rq->rescnt != 0) {
if (fp->fs_pid)
- kill_p
roc
(fp->fs_pid, SIGHUP, 1);
+ kill_p
id
(fp->fs_pid, SIGHUP, 1);
}
fp->rdbuf_size = 0;
raw3270_request_reset(rq);
}
fp->rdbuf_size = 0;
raw3270_request_reset(rq);
@@
-174,7
+173,7
@@
fs3270_save_callback(struct raw3270_request *rq, void *data)
*/
if (rq->rc != 0 || rq->rescnt == 0) {
if (fp->fs_pid)
*/
if (rq->rc != 0 || rq->rescnt == 0) {
if (fp->fs_pid)
- kill_p
roc
(fp->fs_pid, SIGHUP, 1);
+ kill_p
id
(fp->fs_pid, SIGHUP, 1);
fp->rdbuf_size = 0;
} else
fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
fp->rdbuf_size = 0;
} else
fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
@@
-420,16
+419,20
@@
fs3270_open(struct inode *inode, struct file *filp)
struct idal_buffer *ib;
int minor, rc;
struct idal_buffer *ib;
int minor, rc;
- if (imajor(filp->f_dentry->d_inode) != IBM_FS3270_MAJOR)
+ if (imajor(filp->f_
path.
dentry->d_inode) != IBM_FS3270_MAJOR)
return -ENODEV;
return -ENODEV;
- minor = iminor(filp->f_dentry->d_inode);
+ minor = iminor(filp->f_
path.
dentry->d_inode);
/* Check for minor 0 multiplexer. */
if (minor == 0) {
/* Check for minor 0 multiplexer. */
if (minor == 0) {
- if (!current->signal->tty)
+ struct tty_struct *tty;
+ mutex_lock(&tty_mutex);
+ tty = get_current_tty();
+ if (!tty || tty->driver->major != IBM_TTY3270_MAJOR) {
+ mutex_unlock(&tty_mutex);
return -ENODEV;
return -ENODEV;
- if (current->signal->tty->driver->major != IBM_TTY3270_MAJOR)
-
return -ENODEV
;
- m
inor = current->signal->tty->index + RAW3270_FIRSTMINOR
;
+ }
+
minor = tty->index + RAW3270_FIRSTMINOR
;
+ m
utex_unlock(&tty_mutex)
;
}
/* Check if some other program is already using fullscreen mode. */
fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor);
}
/* Check if some other program is already using fullscreen mode. */
fp = (struct fs3270 *) raw3270_find_view(&fs3270_fn, minor);
@@
-443,7
+446,7
@@
fs3270_open(struct inode *inode, struct file *filp)
return PTR_ERR(fp);
init_waitqueue_head(&fp->wait);
return PTR_ERR(fp);
init_waitqueue_head(&fp->wait);
- fp->fs_pid =
current->pid
;
+ fp->fs_pid =
get_pid(task_pid(current))
;
rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
if (rc) {
fs3270_free_view(&fp->view);
rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
if (rc) {
fs3270_free_view(&fp->view);
@@
-481,7
+484,8
@@
fs3270_close(struct inode *inode, struct file *filp)
fp = filp->private_data;
filp->private_data = NULL;
if (fp) {
fp = filp->private_data;
filp->private_data = NULL;
if (fp) {
- fp->fs_pid = 0;
+ put_pid(fp->fs_pid);
+ fp->fs_pid = NULL;
raw3270_reset(&fp->view);
raw3270_put_view(&fp->view);
raw3270_del_view(&fp->view);
raw3270_reset(&fp->view);
raw3270_put_view(&fp->view);
raw3270_del_view(&fp->view);