aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/fs3270.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/fs3270.c')
-rw-r--r--drivers/s390/char/fs3270.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index b4557fa30858..78f8bda81dae 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -27,7 +27,7 @@ struct raw3270_fn fs3270_fn;
27 27
28struct fs3270 { 28struct fs3270 {
29 struct raw3270_view view; 29 struct raw3270_view view;
30 pid_t fs_pid; /* Pid of controlling program. */ 30 struct pid *fs_pid; /* Pid of controlling program. */
31 int read_command; /* ccw command to use for reads. */ 31 int read_command; /* ccw command to use for reads. */
32 int write_command; /* ccw command to use for writes. */ 32 int write_command; /* ccw command to use for writes. */
33 int attention; /* Got attention. */ 33 int attention; /* Got attention. */
@@ -102,7 +102,7 @@ fs3270_restore_callback(struct raw3270_request *rq, void *data)
102 fp = (struct fs3270 *) rq->view; 102 fp = (struct fs3270 *) rq->view;
103 if (rq->rc != 0 || rq->rescnt != 0) { 103 if (rq->rc != 0 || rq->rescnt != 0) {
104 if (fp->fs_pid) 104 if (fp->fs_pid)
105 kill_proc(fp->fs_pid, SIGHUP, 1); 105 kill_pid(fp->fs_pid, SIGHUP, 1);
106 } 106 }
107 fp->rdbuf_size = 0; 107 fp->rdbuf_size = 0;
108 raw3270_request_reset(rq); 108 raw3270_request_reset(rq);
@@ -173,7 +173,7 @@ fs3270_save_callback(struct raw3270_request *rq, void *data)
173 */ 173 */
174 if (rq->rc != 0 || rq->rescnt == 0) { 174 if (rq->rc != 0 || rq->rescnt == 0) {
175 if (fp->fs_pid) 175 if (fp->fs_pid)
176 kill_proc(fp->fs_pid, SIGHUP, 1); 176 kill_pid(fp->fs_pid, SIGHUP, 1);
177 fp->rdbuf_size = 0; 177 fp->rdbuf_size = 0;
178 } else 178 } else
179 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt; 179 fp->rdbuf_size = fp->rdbuf->size - rq->rescnt;
@@ -442,7 +442,7 @@ fs3270_open(struct inode *inode, struct file *filp)
442 return PTR_ERR(fp); 442 return PTR_ERR(fp);
443 443
444 init_waitqueue_head(&fp->wait); 444 init_waitqueue_head(&fp->wait);
445 fp->fs_pid = current->pid; 445 fp->fs_pid = get_pid(task_pid(current));
446 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor); 446 rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
447 if (rc) { 447 if (rc) {
448 fs3270_free_view(&fp->view); 448 fs3270_free_view(&fp->view);
@@ -480,7 +480,8 @@ fs3270_close(struct inode *inode, struct file *filp)
480 fp = filp->private_data; 480 fp = filp->private_data;
481 filp->private_data = NULL; 481 filp->private_data = NULL;
482 if (fp) { 482 if (fp) {
483 fp->fs_pid = 0; 483 put_pid(fp->fs_pid);
484 fp->fs_pid = NULL;
484 raw3270_reset(&fp->view); 485 raw3270_reset(&fp->view);
485 raw3270_put_view(&fp->view); 486 raw3270_put_view(&fp->view);
486 raw3270_del_view(&fp->view); 487 raw3270_del_view(&fp->view);