* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return value in
FIONBIO case.
This commit is contained in:
		| @@ -1,3 +1,8 @@ | |||||||
|  | 2003-10-23  Christopher Faylor  <cgf@redhat.com> | ||||||
|  |  | ||||||
|  | 	* fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return | ||||||
|  | 	value in FIONBIO case. | ||||||
|  |  | ||||||
| 2003-10-23  Corinna Vinschen  <corinna@vinschen.de> | 2003-10-23  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* fhandler_proc.cc (format_proc_partitions): Use new device code | 	* fhandler_proc.cc (format_proc_partitions): Use new device code | ||||||
|   | |||||||
| @@ -1025,6 +1025,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg) | |||||||
|       raise (SIGTTOU); |       raise (SIGTTOU); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |   int retval; | ||||||
|   switch (cmd) |   switch (cmd) | ||||||
|     { |     { | ||||||
|     case TIOCGWINSZ: |     case TIOCGWINSZ: | ||||||
| @@ -1033,6 +1034,7 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg) | |||||||
|       break; |       break; | ||||||
|     case FIONBIO: |     case FIONBIO: | ||||||
|       set_nonblocking (*(int *) arg); |       set_nonblocking (*(int *) arg); | ||||||
|  |       retval = 0; | ||||||
|       goto out; |       goto out; | ||||||
|     default: |     default: | ||||||
|       set_errno (EINVAL); |       set_errno (EINVAL); | ||||||
| @@ -1086,14 +1088,14 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg) | |||||||
|     } |     } | ||||||
|  |  | ||||||
|   release_output_mutex (); |   release_output_mutex (); | ||||||
|  |   retval = get_ttyp ()->ioctl_retval; | ||||||
| out: |  | ||||||
|   int retval = get_ttyp ()->ioctl_retval; |  | ||||||
|   if (retval < 0) |   if (retval < 0) | ||||||
|     { |     { | ||||||
|       set_errno (-retval); |       set_errno (-retval); | ||||||
|       retval = -1; |       retval = -1; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | out: | ||||||
|   termios_printf ("%d = ioctl (%x)", retval, cmd); |   termios_printf ("%d = ioctl (%x)", retval, cmd); | ||||||
|   return retval; |   return retval; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user