Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull TTY revert from Greg KH:
"Here is a single commit, a revert of a sysfs file change that ended up
breaking a userspace tool"

* tag 'tty-3.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
Revert "tty: Set correct tty name in 'active' sysfs attribute"

+8 -20
+1 -2
Documentation/ABI/testing/sysfs-tty
··· 3 3 Contact: Kay Sievers <kay.sievers@vrfy.org> 4 4 Description: 5 5 Shows the list of currently configured 6 - tty devices used for the console, 7 - like 'tty1 ttyS0'. 6 + console devices, like 'tty1 ttyS0'. 8 7 The last entry in the file is the active 9 8 device connected to /dev/console. 10 9 The file supports poll() to detect virtual
+7 -18
drivers/tty/tty_io.c
··· 1267 1267 * @p: output buffer of at least 7 bytes 1268 1268 * 1269 1269 * Generate a name from a driver reference and write it to the output 1270 - * buffer. Return the number of bytes written. 1270 + * buffer. 1271 1271 * 1272 1272 * Locking: None 1273 1273 */ 1274 - static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p) 1274 + static void tty_line_name(struct tty_driver *driver, int index, char *p) 1275 1275 { 1276 1276 if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE) 1277 - return sprintf(p, "%s", driver->name); 1277 + strcpy(p, driver->name); 1278 1278 else 1279 - return sprintf(p, "%s%d", driver->name, 1280 - index + driver->name_base); 1279 + sprintf(p, "%s%d", driver->name, index + driver->name_base); 1281 1280 } 1282 1281 1283 1282 /** ··· 3545 3546 if (i >= ARRAY_SIZE(cs)) 3546 3547 break; 3547 3548 } 3548 - while (i--) { 3549 - struct tty_driver *driver; 3550 - const char *name = cs[i]->name; 3551 - int index = cs[i]->index; 3552 - 3553 - driver = cs[i]->device(cs[i], &index); 3554 - if (driver) { 3555 - count += tty_line_name(driver, index, buf + count); 3556 - count += sprintf(buf + count, "%c", i ? ' ':'\n'); 3557 - } else 3558 - count += sprintf(buf + count, "%s%d%c", 3559 - name, index, i ? ' ':'\n'); 3560 - } 3549 + while (i--) 3550 + count += sprintf(buf + count, "%s%d%c", 3551 + cs[i]->name, cs[i]->index, i ? ' ':'\n'); 3561 3552 console_unlock(); 3562 3553 3563 3554 return count;