Commit Graph

13888 Commits

Author SHA1 Message Date
christos e35c1a2b0b redo the connection waiting handling to make it more clear. 2019-04-07 00:44:54 +00:00
christos 2a5b01fca8 Fix asan heap buffer overflow. from enh at google. 2019-04-05 13:34:41 +00:00
wiz 95f5209749 New sentence, new line. Whitespace fixes. 2019-04-04 22:02:06 +00:00
kamil b844317c23 FreeBSD indent r340138 2019-04-04 20:39:17 +00:00
kamil d845d12b1a Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.

FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.

Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.

Major chages in this import:

 - Added an option -ldi<N> to control indentation of local variable names.
 - Added option -P for loading user-provided files as profiles
 - Added -tsn for setting tabsize
 - Rename -nsac/-sac ("space after cast") to -ncs/-cs
 - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines.
 - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
 - Group global option variables into an options structure
 - Use bsearch() for looking up type keywords.
 - Don't produce unneeded space character in function declarators
 - Don't unnecessarily add a blank before a comment ends.
 - Don't ignore newlines after comments that follow braces.

Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.

Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.

Part II, checkin new files.
2019-04-04 15:27:35 +00:00
kamil d6a1bc3f07 Upgrade indent(1)
Merge all the changes from the recent FreeBSD HEAD snapshot
into our local copy.

FreeBSD actively maintains this program in their sources and their
repository contains over 100 commits with changes.

Keep the delta between the FreeBSD and NetBSD versions to absolute
minimum, mostly RCS Id and compatiblity fixes.

Major chages in this import:

 - Added an option -ldi<N> to control indentation of local variable names.
 - Added option -P for loading user-provided files as profiles
 - Added -tsn for setting tabsize
 - Rename -nsac/-sac ("space after cast") to -ncs/-cs
 - Added option -fbs Enables (disables) splitting the function declaration and opening brace across two lines.
 - Respect SIMPLE_BACKUP_SUFFIX environment variable in indent(1)
 - Group global option variables into an options structure
 - Use bsearch() for looking up type keywords.
 - Don't produce unneeded space character in function declarators
 - Don't unnecessarily add a blank before a comment ends.
 - Don't ignore newlines after comments that follow braces.

Merge the FreeBSD intend(1) tests with our ATF framework.
All tests pass.

Upgrade prepared by Manikishan Ghantasala.
Final polishing by myself.
2019-04-04 15:22:13 +00:00
christos a5b9754eb4 Make fetch_read() return size_t like fread() does. It is bogus to
have one backing implementation that returns different values and
types than the other.  Handle error setting properly; i.e. bail
out if the internal read returned an error. Now we get a proper
error message when the the server resets our connection instead of
a warning that the right failed with an invalid argument.

The server used for testing was:
	http://capeweather.dyndns.org:8080/graphs/3474.png
Which seems to be unreliable :-)
2019-04-04 00:36:09 +00:00
kre 67d9f38e0b Use correct printf format for (struct input_file *)->lineno
SHould unbreak 32 bit host builds.
2019-03-26 23:31:45 +00:00
christos 26bb5ab43c fix use-after-free issue. 2019-03-26 16:41:06 +00:00
christos 5eea377e88 print the source line and file where the error happened. 2019-03-26 16:39:50 +00:00
christos 82af0135c7 Behave like gnu m4; when the error output file cannot be opened, just warn
and keep going.
2019-03-26 15:00:34 +00:00
maxv ba0aa175c4 Remove compat_osf1, discussed on tech-kern@. 2019-03-25 19:24:29 +00:00
christos 24c1376449 no -g 2019-03-09 16:18:37 +00:00
christos 36c6018433 Fix another bug found by jemalloc: don't access dirent entry after closedir(3). 2019-03-09 16:18:22 +00:00
msaitoh c2f2b1bf58 s/ the the / the / 2019-03-08 08:12:39 +00:00
christos 8238435d7e Add __thread/tls_model attribute 2019-03-04 17:45:16 +00:00
christos 8504f123fd add a two argument version of alloc_size 2019-03-04 15:28:18 +00:00
christos 54f8cd1eb6 add gnu_printf 2019-03-04 15:26:18 +00:00
rin 270ad452f4 When input is not a multiple of three bytes in size, pad null
characters instead of garbage. This makes output reproducible.

Taken from FreeBSD:
https://svnweb.freebsd.org/base?view=revision&revision=84715

Even though this is not demanded by POSIX, uuencode(1) in
FreeBSD, OpenBSD, macOS, and GNU, behaves that way.
2019-03-04 05:37:08 +00:00
christos 0c4ae0a48a Add more gnu attributes 2019-03-03 23:06:08 +00:00
martin f239a04691 msg_prompt_win: allow automatic window height calculation (by passing
height = -1).
2019-03-01 17:02:21 +00:00
gson d8c2103a2e Make xgetchar() return an int like getchar() does, and remove needless cast. 2019-02-28 17:41:27 +00:00
martin a7fc6d1692 Add an option to supress the vertical space between menu title and
menu items.
2019-02-25 20:47:37 +00:00
uwe c07928f07f Check getchar() result for EOF.
Call cleanup(SIGHUP) if we get local EOF, as if we've got SIGHUP.
While here, use EOF constant instead of literal -1 in an existing
check.

PR bin/53996
2019-02-22 22:25:22 +00:00
martin 37df7b8973 Typo in member variable name 2019-02-16 19:09:07 +00:00
martin c8239d06af Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
2019-02-16 18:57:21 +00:00
kre 63ba0d5a97 PR bin/53986 from Christian Weisgerber
Skip forward to tomorrow to run a command earlier in the current
hour than now (as well as during an earlier hour of the day).
2019-02-16 17:56:57 +00:00
gutteridge 1c2ba908cc make(1): minor grammar fixes in BUGS section 2019-02-16 07:41:12 +00:00
mrg d40c522149 remove the hack to remove .eh_frame -- gcc7 is fixed it seems. 2019-02-14 12:22:06 +00:00
mrg 26711b697b while we're still figuring out the gcc7 vs .eh_frame issue, apply
the don't remove eh_frame hack to mips as well.  hpcmips testbed
is also failing currently:

[   3.1238738] panic: init died (signal 6, exit 12)
2019-02-13 20:48:56 +00:00
mrg 91af807154 hack alert time:
on sparc and sparc64, don't remove .eh_frame section.  it leads
to failure as something is referenced, and objcopy ends up
emitting a broken binary that can't be run -- it attempts to
load at va=0, beyond having missing referenced data.

also, on sparc64 also don't remove .note.netbsd.mcmodel.


the former should be revised when we can avoid it.
2019-02-12 10:16:58 +00:00
martin fbb0a702e6 Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).
2019-02-06 20:08:15 +00:00
rin 3a204f953a Make cu(1) and tip(1) recognize newline (^J) as end-of-line.
Now, tilde (~) after newline works as escape character as in ssh(1).
No objections when proposed on tech-userland.
2019-02-06 14:08:50 +00:00
martin c3c1b1c5e7 Try to avoid a (bogus) fatal warning from clang. 2019-02-06 07:56:42 +00:00
mrg 97ee1e16ff rework the previous to only apply if !HOSTPROG 2019-02-04 10:03:16 +00:00
mrg a5ca97c6e5 apply -Wno-error=implicit-fallthrough on files that have fallthru
comments but are missed by the current checker.
2019-02-04 09:51:47 +00:00
mrg e79f0588d7 avoid a potential buffer truncation. 2019-02-04 08:07:33 +00:00
mrg a6590737cd - add justquit() that always exits. use it to avoid unreachable code. 2019-02-04 04:09:13 +00:00
mrg a0193bc54d - use -Wno-error=format-truncation 2019-02-04 03:58:41 +00:00
mrg 85f6c4cfe8 don't build ldd64 support if !MKCOMPAT and mips64. 2019-02-04 00:05:20 +00:00
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
thorpej 68e270a267 Implement support for "pshared" POSIX semaphores.
Fixes lib/53273 (and Firefox's multi-process tab feature).
2019-02-03 03:20:23 +00:00
mrg fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
mrg 2235c7e9bc make a fallthru comment GCC7 compatible. 2019-02-01 08:37:21 +00:00
mrg 684b182f81 compare pointers with NULL not '\0'. 2019-02-01 08:29:03 +00:00
christos 44671790a5 PR/53916: Rob Gill: remove redundant assignment to matchlen. 2019-01-28 12:04:16 +00:00
kre d5635413aa Revert previous, it was based upon a misreading of the POSIX
spec.   POSIX requires "as if by calling strtod()" which we
did already ... by calling strtod().   Go back to doing that.
2019-01-27 12:03:09 +00:00
kre 636d0f3dee Fix merge botch 2019-01-27 05:16:55 +00:00
kre 0eb8e4ef15 Fix merge botch 2019-01-27 05:15:42 +00:00
kre 1300bdf616 Fix merge botch 2019-01-27 05:14:45 +00:00
pgoyette d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
kre 4ca169f245 Always convert input numbers (from the command line) in the C
locale, not as set in the environment.   Conforms with POSIX spec.
2019-01-26 15:22:54 +00:00
christos ace5fc6aeb no need for curses.h 2019-01-25 15:34:22 +00:00
christos 6b2ce0800e PR/53906: Paul Ripke: systat(1) vmstat & syscall get
"alternate system clock has died" on terminal resize (SIGWINCH)
2019-01-25 15:31:11 +00:00
martin cf341f607a Support redrawing all windows when in a msg prompt via Ctrl-l. 2019-01-22 18:39:49 +00:00
martin 0053548254 msg_prompt_win: if the default string fits, show it separately even
in fixed size windows. Previously it would only show up when auto-sizing
prompts figured it would fit (probably an oversight).
2019-01-21 20:28:08 +00:00
uwe a73c12be45 .Pp before .Bd is redundant.
From Edgar Pettijohn.
2019-01-13 16:48:51 +00:00
martin 8a7549a99f Allow argument expansion in menu titles as well. 2019-01-09 19:43:37 +00:00
tih b953ff3f9a Remove a format character from a non-format string. 2019-01-08 08:22:20 +00:00
martin afdad64472 Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
2019-01-06 11:08:34 +00:00
maya 8a135c6afb Match the function prototype of encrypthandler instead of casting to it.
Make GCC 9 snapshot happier with the code

While here, remove unnecessary braces around return (KNF).
2019-01-05 08:55:58 +00:00
maya f96d98db06 Bump WARNS to 5, and remove unnecessary -Wno (tested with pkgsrc clang 7) 2019-01-05 06:59:46 +00:00
maya d9e6b51adf Remove advertising clause, permitted by the copyright author. 2019-01-05 06:56:03 +00:00
maya 68daebb7bc unifdef compatibility for old BSD servers. This has been
disabled, so no binary change. from openbsd.
2019-01-05 06:47:24 +00:00
maya 28da966269 Avoid unnecessary casts, from openbsd. No binary change. 2019-01-05 06:30:05 +00:00
christos 681a027a82 recognize destructor attribute. 2019-01-04 18:51:23 +00:00
martin b8b0f2eea4 Add an option for single (disabled) menu lines to have no shortcut. 2019-01-04 15:27:19 +00:00
martin 01b87e76cf If a menu starts with disabled options, skip those and start at the
first enabled one instead.
2019-01-02 16:32:59 +00:00
martin 0de30d2afa Match all arm (and simplify powerpc conditionals) 2019-01-01 14:01:46 +00:00
christos 395228d264 Update usage comments, add arm 2018-12-31 13:32:05 +00:00
martin 47b9b2b3a0 ibcs2 is gone 2018-12-29 18:09:32 +00:00
wiz 48f9820ef3 Fix some macro usage. Fix a typo. 2018-12-28 12:21:53 +00:00
sevan 3986ee252c Remove commentd out options for fields no longer present in source. 2018-12-26 01:54:09 +00:00
sevan 5a5cdfa229 Extend "systat vm" output to provide better insight about buffercache and
document it.

From Greg A. Woods in PR bin/36542
2018-12-26 01:47:37 +00:00
sevan 66a1de5f19 Remove reference to Installing and Operating 4.3BSD paper, at present it's not
possible to find a paper titled as such with sections starting with
"Interpreting system activity".
There is a "Monitoring System Performance" section present from the 4.1BSD
Installing and Operating paper up to and including the 4.4BSD paper. The advice
in this section has not aged very well.
From "Installing and Operating 4.3BSD-tahoe UNIX on the VAX":
"Cumulatively on one of our large machines we average about 60-100
context switches and interrupts per second and about 70-120 system calls
per second"
2018-12-25 03:38:59 +00:00
christos 2763409dc3 yydebug is now defined only if YYDEBUG is 2018-12-24 02:07:44 +00:00
christos 876968801f yydebug is now available only if YYDEBUG is set. 2018-12-23 19:09:03 +00:00
sjg 38267d9f3b ParseVErrorInternal: use .PARSEDIR and
apply realpath(3) if not absolute,
and use .PARSEFILE for consitent results.

Reviewed by: christos
2018-12-22 00:36:32 +00:00
sjg dca4343b05 unexport-env: avoid SEGFAULT if MAKELEVEL not in env 2018-12-21 05:50:19 +00:00
martin b18e79c6bb compat/svr4* is gone - adapt 2018-12-19 16:27:26 +00:00
christos 07ed41e72f - Default terminator to \n
- Don't print a trailing separator
Behavior now matches GNU seq (from Aram at tech-userlevel)
2018-12-17 20:10:51 +00:00
christos 25ae7c06e6 PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.
2018-12-17 02:06:00 +00:00
christos 3b6f899d34 use %s formats to avoid -flag confusion (from sjg) 2018-12-16 18:53:34 +00:00
christos 3aa82d61be Use printf instead of echo since we can't portably use \ in string (from sjg@)
http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html
2018-12-16 17:30:57 +00:00
maya c1e97742c6 Remove README relevant to 1995 telnet. 2018-12-15 22:56:51 +00:00
wiz 4abf4a7a7a Remove reference to krb_realmofhost(3) which does not exist.
Someone who speaks kerberos might want to check the -k description.

Remove some macros that do nothing and use \(em.
2018-12-15 22:17:02 +00:00
maya 067f4a3470 You can encrypt outside of north america now. 2018-12-15 22:12:15 +00:00
christos dbe0036b5a minor cleanup:
- more const
- prevent overflow of the argument vector
- change a lot of unsigned to signed to eliminate casts
2018-12-14 23:40:17 +00:00
maya 4f0678d2a5 Remove unneeded casts 2018-12-14 06:28:49 +00:00
maya 5d185efcae Remove some effectively if 0'd code. 2018-12-14 06:27:40 +00:00
maya 5b38d170b8 Inline the only use of NetNonblockingIO.
While here inline SetSockOpt. From openbsd.
2018-12-14 06:17:30 +00:00
maya 4e424770ac G/C In3270 - always false 2018-12-14 06:08:18 +00:00
maya 6aa0aef1f6 Expand SIG_FUNC_RET -from openbsd. 2018-12-13 09:20:05 +00:00
maya 16d5f4a25f Remove unused code. 2018-12-13 09:07:53 +00:00
maya e1e42e087d Remove unused code. 2018-12-13 05:22:14 +00:00
maya 342e9885b0 ExitString is used for error exit, do the minimum necessary here.
Avoid infinite loop:
telrcv->suboption->ExitString->SetForExit->telrcv

Reported by hacker fantastic, thanks!
2018-12-13 05:15:11 +00:00
maya 233931799b static-ify. 2018-12-13 05:07:03 +00:00
maya 7c20b20625 unifdef TN3270 which is never defined (and wouldn't build if it was)
delete tn3270 file no longer needed.
SetIn3270(); expands to nothing now, so remove it.

No functional change.
2018-12-13 04:49:19 +00:00
sevan a07b17440a typo 2018-12-13 01:58:04 +00:00
sevan daf842171c Describe what happens when you run vmstat witout any options aka the first line
of vmstat.
2018-12-13 01:29:10 +00:00