Commit Graph

128 Commits

Author SHA1 Message Date
gson fb72156a3c Added volatile keyword to variable that might be clobbered by longjmp 2006-10-24 08:29:47 +00:00
christos 97e81e479c sprinkle volatile. 2006-10-22 16:48:34 +00:00
christos c3c65c3c0c use c99 initializer. 2006-10-22 16:47:50 +00:00
christos 528614c11b sprinkle volatile. 2006-10-22 16:45:35 +00:00
dan 450da78dd9 the intention of the whole tip-as-cu thing was to allow tip-as-cu and
have a cu command installed, even when the rest of uucp was removed
via MKUUCP=no.  The old uucp-derived cu is no more, and is not
installed in either case.

make it so, by correcting some confusion that had made the non-uucp
tip-as-cu cu conditional on MKUUCP
2006-05-22 12:32:20 +00:00
mrg 4bc6feceb6 end the argument list to exec*(3) with a NULL instead of a bare '0', as
the latter isn't a pointer context in these varargs functions.
2006-05-11 00:22:52 +00:00
christos f84f0d3321 Coverity CID 2972, 2973: Don't call close() with a negative fd. 2006-04-30 23:34:50 +00:00
christos 258969c334 Include bsd.own.mk; from Jukka Salmi 2006-04-08 20:07:29 +00:00
yamt 2267ff751f cuhelp: fix a typo in usage. 2006-04-05 23:30:57 +00:00
tron 442e61c603 Fix "MKUUCP" check so that "cu" installed if "MKUUCP" is not defined. 2006-04-05 13:04:33 +00:00
dyoung ca9de39d07 If MKUUCP=no, do not create links for cu and its manual page. 2006-04-04 15:09:50 +00:00
tls 76f2334c55 Use closefrom, don't iterate over file descriptors from 3 to 20. 2006-04-03 16:13:34 +00:00
tls a973ebec53 Replace abuse of SIGIOT, SIGEMT, SIGSYS for communication between the
TIPIN and TIPOUT processes with a third "attention" pipe.  While we're
here, fix a few other minor nits like the hardcoded use of fd 3 in
consh().

Now ~+/~C appear to work.  This must have been broken for years.
2006-04-03 16:03:50 +00:00
tls 374e37364a Move "cucommon" label (ugh) to above the O_NONBLOCK handling for direct
connections.  This stops the tipout process from spinning.
2006-04-03 14:54:16 +00:00
christos cb82eb0f6b Redo the previous in the tip sanctioned way :-) 2006-04-03 14:12:29 +00:00
he 3a81e1c420 For the benefit of our 64-bit ports, we need to cast via intptr_t when
casting from pointer to unsigned int.
2006-04-03 13:00:48 +00:00
wiz e9a003bced Use Dq, punctuation vs whitespace nits. 2006-04-03 05:56:20 +00:00
yamt e6e5a0e51b actually set up baudrate after rev.1.33. 2006-04-03 05:08:40 +00:00
yamt 25e67975a5 fix a typo in LINKS. 2006-04-03 05:05:55 +00:00
christos c4341bc3e1 Pass a little lint. 2006-04-03 04:53:58 +00:00
perry 29dc02e572 delinting. more needed. (lint found some real bugs that I haven't fixed yet.) 2006-04-03 04:25:30 +00:00
perry b43b6e6666 Merge a few of the OpenBSD manual page changes. Not yet close to
finished but I have to break for now and Thor will probably pick up
from where I left off.
2006-04-03 03:46:34 +00:00
tls 125606b781 Wwwwwwww! Do not remove variables from the vtable in vars.c without
changing the indices in tip.h -- what a terrible design.

Okay, "design".  Fine.  Whatever. ;-)  Now we don't dump core all the time.
2006-04-03 03:13:10 +00:00
perry 31f14bb93a Clean up a bit. 2006-04-03 02:33:19 +00:00
perry d71f683e39 Remove vestiges of the ACULOG support. It depended on the suid support
(which is now gone) and it is woefully obsolete -- if something
analogous is ever needed in the future, syslog is the way to do it.
2006-04-03 02:25:27 +00:00
tls bc4c5be2bf Now we use tip-as-cu, not Taylor UUCP cu.
These programs are no longer setuid, and now lock devices with flock,
not file locks in /var/spool/.  They will no longer lock against UUCP
itself unless we modify UUCP to lock with flock, but this seems highly
unlikely to be an issue in the present day.
2006-04-03 02:21:13 +00:00
perry 8a1d2efb73 remove refs to uucp locking and aculog 2006-04-03 02:14:26 +00:00
tls 6bd8b21472 The ~C / ~+ command is no longer optional. 2006-04-03 02:06:44 +00:00
perry eee85da04c Remove support for uucp style locking.
This means we can get rid of the suid/sgid parts of the code (which
have been removed). The program is now installed with normal permissions.

To prevent accidents, we now flock the tty line, attempting to get an
exclusive lock.

Reviewed by: tls
2006-04-03 02:01:28 +00:00
tls 896b79dbc8 If we're not given a phone number or system name to dial, use "direct
connect" mode -- in other words, set CLOCAL so the user can talk to the
device before CD.
2006-04-03 01:48:22 +00:00
tls bed8070daa Whoops. We don't *use* log.o, so don't *build* it. 2006-04-03 01:47:20 +00:00
perry 58c2151f1e ANSIfy decls, de-__P, clean trailing whitespace 2006-04-03 00:51:13 +00:00
tls 4c0b53d7b4 At Luke Mewburn's suggestion, disable "force" by default, too. Those using
the tip frontend who really want ^P used for "send literal" can turn it on
in tiprc or remote.
2006-04-02 23:25:35 +00:00
tls edddcc4ac8 Add another Taylor compat option, --nostop to disable software flow control
(a.k.a. "tandem" mode).  While we're here, fix a buglet with --halfduplex,
and add --flow {hard, soft, none}.  Note that you can't get *both* hard and
soft flow control using the command-line option; if you want that, you
have to set the variables in tiprc or with ~s once tip is running.

Move all setting of vars.c named variables to *after* the call to vinit().
2006-04-02 22:19:26 +00:00
tls da6a898cf6 Oddly enough, smashing CRTSCTS into the terminal input flags doesn't do
much; it is a control flag.

Now toggling hardware flow control works.
2006-04-02 20:44:20 +00:00
tls 6b0f06d935 Fix the conditional compilation on ACULOG so it actually works.
Turn it off by default -- it hardly saves any space, but it's
one of the reasons why the executable is installed setuid, and
other versions of tip/cu don't write a log file anyway.  We can
add syslog support later if we ever really want this back, the
file-writing is all encapsulated in log.c.
2006-04-02 19:16:22 +00:00
tls ad69069bcc New 'cu' command-line handling, derived from Todd Miller's in OpenBSD,
but with some long options added for Taylor 'cu' compatibility, and
with some bugs fixed (in particular, the handling of -# now works as
documented and does not overwrite argv).
2006-04-02 19:04:24 +00:00
tls 0b7476a655 Remove extra \n from call to warn() 2006-04-02 19:03:55 +00:00
tls b3de57c6bf Don't build any of the dialers except Hayes. If anyone is using any of
the others (maybe "Courier", but I doubt it) we can easily enough turn
them back on.

Saves 20-30K depending on platform.  Not totally insignificant, since this
often goes on install media, or very small systems.
2006-04-02 19:00:40 +00:00
tls b8dc57b8d9 If we might have two links, we'd better print our program name when we
emit an error -- and it would be nice if it were the *right* program name.
Since it's convenient, change most perror calls to warn, and a lot of
fprintf ...  exit to errx.  Fix at least one fprintf that could run off
the end of its arguments (%s but no argument, how did we never catch this?).
2006-04-02 06:11:45 +00:00
tls 82222cd3ac Default to no parity instead of even parity. OpenBSD made this change
long ago, and I think it makes sense.
2006-04-02 04:28:38 +00:00
tls 685d2e5048 Default the "raisechar" value (for the insane old case-mapping) to NULL.
As the same change in the OpenBSD tree says, "if you are crazy enough
to want it, then it can be turned on in /etc/remote."
2006-04-02 04:25:36 +00:00
tls 8139858166 Default baud rate to 9600 (was 1200) to match Taylor cu. 2006-04-02 04:10:54 +00:00
tls 7d1bef10da Add the rest of the speeds listed in termios.h. This is not, perhaps, as
sensible as the way OpenBSD supports arbitrary speeds; but we hardly add
new speeds often and this change is a lot less invasive.
2006-04-02 04:02:00 +00:00
tls 40bdc77642 Change manual page (as OpenBSD did) to reflect the actual arrangement of
file descriptors with ~C, instead of some weird ancient arrangement.

Document ~+ as a synonym for ~C.
2006-04-02 03:15:02 +00:00
tls b389579aca Add "~+" as a synonym for "~C" for Taylor cu compatibility. 2006-04-02 03:10:54 +00:00
yamt 01ef02441c pull the following change from OpenBSD
and bump date of the manpage.

    date: 2003/09/20 18:15:32;  author: millert;  state: Exp;  lines: +4 -2
    Implement hardwareflow varable in tip(1) like Solaris and hf in /etc/remote.
    Based on PR 3411 from Matthew Gream
    Also document "tandem" variable (XON/XOFF) in tip man page.
2006-03-29 12:37:59 +00:00
christos d8a5b3caf5 warns=4 2006-03-16 23:25:17 +00:00
gavan f1f29c8b8d Treat EOF the same as EIO. Prevents spinning if an EOF condition is
encountered, such as a USB serial device being unplugged.

Instead of spinning, the process reading from the serial line will exit,
leaving the process reading from the local terminal to exit when it notices
that its child has gone away.
2005-12-09 03:15:42 +00:00
dsl 293eff3495 Add (unsigned char) cast to ctype functions
islower() can be true for 0x80..0xff
2004-11-04 07:29:09 +00:00