summaryrefslogtreecommitdiffstats
path: root/sys-utils/ldattach.c
Commit message (Collapse)AuthorAgeFilesLines
* misc: replaces atexit(close_stdout) with new close_stdout_atexit()Karel Zak2019-06-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-161-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: Check for value of _HAVE_STRUCT_TERMIOS_C_ISPEEDKhem Raj2019-01-051-1/+1
| | | | | | | | | | in glibc 2.29+ checking for just existence of _HAVE_STRUCT_TERMIOS_C_ISPEED won't be enough, the value has to be checked see https://sourceware.org/git/?p=glibc.git;a=commit;h=e5a50db36eaa6e8c6427b3a971563240b633ca85 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* ldattach: simplify debugging function when vwarnx(3) is availableSami Kerola2017-07-151-3/+7
| | | | | | | The vwarnx(3) is probably not available in all libc implementations, in such cases use the earlier printout as a fallback. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 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(ERROR)Ruediger Meier2017-06-261-8/+10
| | | | | | | | | | We are using better/shorter error messages and somtimes also errtryhelp(). Here we fix all cases where the usage function took an int argument for exit_code. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Use --help suggestion on invalid optionKarel Zak2016-12-191-2/+1Star
| | | | | | | | 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>
* ldattach: tiny coding style changesKarel Zak2015-07-151-5/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: order line disciplines canonicallyTilman Schmidt2015-07-151-6/+7
| | | | | | | List line disciplines in numerical order and put official names before convenience aliases. Signed-off-by: Tilman Schmidt <tilman@imap.cc>
* ldattach: always set line speed and format for N_GIGASET_M101Tilman Schmidt2015-07-151-1/+11
| | | | | | | | | | | | | The Gigaset M101 exhibits particularly awkward and confusing behaviour when the serial line speed isn't set to what the device expects: Configuration mode detects the used speed and works anyway, but data mode silently fails. Troubleshooting this is enormously time-consuming. Spare the users this trouble by setting the line speed and format to these devices' factory default values as long as the command line doesn't say otherwise. Signed-off-by: Tilman Schmidt <tilman@imap.cc>
* ldattach: adapt print_table column width to widest entryTilman Schmidt2015-07-151-2/+2
| | | | | | | The hardcoded column width of 10 in print_table() is not enough, as the currently longest table entry to be printed has 12 characters. Signed-off-by: Tilman Schmidt <tilman@imap.cc>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-1/+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>
* ldattach: add fallback for N_GSM0710Karel Zak2014-11-211-0/+3
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/133 Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: GSM0710 support, add intro modem commandKarel Zak2014-11-181-2/+93
| | | | | | | | | | Patch add: --intro-command string : send command to modem --pause value : define delay between intro command and ldattach Based on patch from Martin Schmid <scm@aps-systems.ch> Signed-off-by: Karel Zak <kzak@redhat.com>
* blkid, hwclock, ldattach: use program_invocation_short_nameSami Kerola2013-04-261-3/+0Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: cleanup strtoxx_or_err()Karel Zak2012-05-151-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: add default case to switchesSami Kerola2011-11-021-0/+12
| | | | | | | | | | | The warnings bellow are about impossible case, so makign abort() as default seems correct. ldattach.c:305:2: warning: switch missing default case [-Wswitch-default] ldattach.c:313:2: warning: switch missing default case [-Wswitch-default] ldattach.c:321:2: warning: switch missing default case [-Wswitch-default] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: convert debug macro to functionSami Kerola2011-11-021-7/+17
| | | | | | warning: ISO C does not permit named variadic macros Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: check numeric user inputs with strtol_or_errSami Kerola2011-11-021-18/+7Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: align with howto-usage-function.txtSami Kerola2011-11-021-12/+25
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: fix coding styleSami Kerola2011-11-021-218/+227
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ldattach: cleanup usage()Karel Zak2011-08-161-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+0Star
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* ldattach: prints help to stdoutKarel Zak2010-03-011-5/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: add --iflag command line optionTilman Schmidt2010-03-011-3/+58
| | | | | | | | | | | | | Add a command line option '-i' / '--iflag' for setting or clearing input flags on the serial device before attaching the line discipline. [kzak@redhat.com: - use generic functions for work with iflags table - add list of iflags to usage/help output - move iflags parsing to separate function] Impact: added functionality Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: create a generic functions for name=value tablesKarel Zak2010-03-011-14/+29
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: use c.hKarel Zak2009-10-161-4/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: add N_PPS supportTilman Schmidt2009-06-291-1/+6
| | | | | | | | | Add support for a line discipline name "PPS" selecting the Pulse Per Second line discipline N_PPS (18). The number has been reserved since kernel release 2.6.28, and the implementation is finally going to be submitted for kernel release 2.6.31. Signed-off-by: Tilman Schmidt <tilman@imap.cc>
* ldattach: use glibc termiosKarel Zak2008-04-091-110/+36Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: add NLS supportKarel Zak2008-03-251-14/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ldattach: new commandTilman Schmidt2008-03-101-0/+327
Add an ldattach(8) utility program similar to the one in OpenBSD. Signed-off-by: Tilman Schmidt <tilman@imap.cc>