tun.c (a7385ba21102a90f902055f9f185ca02bf62fa43) | tun.c (eac9e902658dab1e097b8ef064e9e3d16c152cc9) |
---|---|
1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 368 unchanged lines hidden (view full) --- 377 378/* Poll */ 379static unsigned int tun_chr_poll(struct file *file, poll_table * wait) 380{ 381 struct tun_struct *tun = file->private_data; 382 unsigned int mask = POLLOUT | POLLWRNORM; 383 384 if (!tun) | 1/* 2 * TUN - Universal TUN/TAP device driver. 3 * Copyright (C) 1999-2002 Maxim Krasnyansky <maxk@qualcomm.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 368 unchanged lines hidden (view full) --- 377 378/* Poll */ 379static unsigned int tun_chr_poll(struct file *file, poll_table * wait) 380{ 381 struct tun_struct *tun = file->private_data; 382 unsigned int mask = POLLOUT | POLLWRNORM; 383 384 if (!tun) |
385 return -EBADFD; | 385 return POLLERR; |
386 387 DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); 388 389 poll_wait(file, &tun->read_wait, wait); 390 391 if (!skb_queue_empty(&tun->readq)) 392 mask |= POLLIN | POLLRDNORM; 393 --- 877 unchanged lines hidden --- | 386 387 DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name); 388 389 poll_wait(file, &tun->read_wait, wait); 390 391 if (!skb_queue_empty(&tun->readq)) 392 mask |= POLLIN | POLLRDNORM; 393 --- 877 unchanged lines hidden --- |