summaryrefslogtreecommitdiffstats
path: root/term-utils/mesg.c
Commit message (Collapse)AuthorAgeFilesLines
* mesg: avoid 'ttyname failed: Success' messageKarel Zak2019-05-271-3/+14
| | | | | | | | | | | | | The ttyname(3) can fail to access /dev/ path, and that will cause function to fail without setting errno value with result of rather confusing error message. Lets start setting stdin permission via /proc when this happens as a go-around, with hope kernel following symlink does not fail. Ok, noted, that hopes of symlink follow working are pretty slim. Based on patch from Sami Kerola <kerolasa@iki.fi>. Reference: https://github.com/lxc/lxd/issues/1724 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mesg: do not print 'ttyname failed' message unless --verbose requestedSami Kerola2018-08-031-0/+5
| | | | | | | | | | | | | | | Lots of people are confused why mesg(1) is priting this message. Usual cause seems to be an uninteractive shell trying to turn running 'mesg n' from a /root/.profile where command invocation is by default on debian based systems. This might be rare case when failing silently is better. [kzak@redhat.com: - add note to the man page - fix if(isatty()) logic] Reference: https://www.google.com/search?q=mesg+ttyname+failed Review: https://marc.info/?l=util-linux-ng&m=153319988631233&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-291-2/+2
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-271-2/+1Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(stderr)Ruediger Meier2017-06-261-4/+5
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-02-201-4/+4
| | | | | | | | | | text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-1/+1
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* mesg: fix multiple racesSami Kerola2015-11-221-8/+14
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rpmatch: use symbolic value when evaluation return codesSami Kerola2015-02-241-3/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: grammarize and harmonize the stat error messageBenno Schulenberg2015-02-021-1/+1
| | | | | | | | | The message "stat failed %s" seems to say that stat() failed to do something, or failed to pass a test, but of course it means that the statting of something failed. So say so. Also make two very similar messages equal to this one. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+4
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* various: fix mixing declarations and code compiler warnings [smatch]Sami Kerola2013-10-081-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: sync usage() with howto-usage-function.txtSami Kerola2013-08-291-8/+7Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* add missing rpmatch.h everywhere it needs to beWilliam Pitcock2013-02-201-0/+1
| | | | | Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: spell and encode the name of Arkadiusz Miƛkiewicz correctlyBenno Schulenberg2013-02-061-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* translation: unify stat error messagesSami Kerola2012-07-161-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* term-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+3
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: use rpmatch to yes/no questionSami Kerola2012-03-181-5/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: cleanup usage()Karel Zak2011-08-161-6/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mesg: add \n to usage() outputKarel Zak2011-04-141-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mesg: new --verbose optionSami Kerola2011-04-141-2/+11
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* mesg: use long options, also --help and --version addedSami Kerola2011-04-141-7/+30
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: move mesg to term-utils/Karel Zak2011-03-021-0/+118
Signed-off-by: Karel Zak <kzak@redhat.com>