Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153512442
D6828.id19352.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
531 B
Referenced Files
None
Subscribers
None
D6828.id19352.diff
View Options
Index: head/usr.bin/tty/tty.c
===================================================================
--- head/usr.bin/tty/tty.c
+++ head/usr.bin/tty/tty.c
@@ -63,17 +63,18 @@
case '?':
default:
usage();
+ /* NOTREACHED */
}
- t = ttyname(0);
+ t = ttyname(STDIN_FILENO);
if (!sflag)
puts(t ? t : "not a tty");
- exit(t ? 0 : 1);
+ exit(t ? EXIT_SUCCESS : EXIT_FAILURE);
}
static void
usage(void)
{
- fprintf(stderr, "usage: tty [-s]\n");
+ fprintf(stderr, "usage: %s [-s]\n", getprogname());
exit(2);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 1:38 PM (7 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31982184
Default Alt Text
D6828.id19352.diff (531 B)
Attached To
Mode
D6828: usr.bin/tty/tty.c: Use proper definition of exit status code and stdin macro
Attached
Detach File
Event Timeline
Log In to Comment