Commit Graph

29 Commits

Author SHA1 Message Date
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
Ulrich Spörlein
487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Ben Laurie
9bde021a87 Fix clang warnings.
Note: these were actually bugs (printf with no format string).

Approved by: philip (mentor)
2011-05-18 20:52:52 +00:00
Doug Rabson
d458f4629b When generating thread-safe server code, handle procedures with void return
types correctly.
2008-08-12 13:38:06 +00:00
Xin LI
f7504c33c4 Use POSIX mutex instead of Solaris ones. This makes generation
of threaded RPC servers to work out of the box.

Spotted by:	Changming Sun <changming at staff.sina.com.cn>
Sponsored by:	SINA Corporation
Approved by:	re (kensmith)
2007-08-23 09:39:40 +00:00
Stefan Eßer
03fec0bdbc Never define the generated rpc server main function with storage type
"static". The header file generated by "rpcgen -h" will always declare
it as extern, leading to a "static after extern" error being issued by
gcc-4.2. This caused only a warning in gcc-3.x, but it has been wrong
all the time.

This change does not modify the code generated by "rpcgen -m", it only
affects rpcgen used to generate server stubs with a local main function.

This is the minimal patch. It does not remove the now obsolete "storage"
parameter from write_program() and write_programs() in an attempt to keep
differences to other systems' versions of rpcgen as small as possible.
2007-06-16 14:39:25 +00:00
Robert Watson
99b671f5a1 In change 1.15, an arbitrary setting of the max RPC record size to
RPC_MAXDATASIZE was introduced.  This is believed to have been debugging
code committed accidentally, although I've been unable to reach the
committer to confirm this.  The effect was to limit the size of RPCs on
TCP and UDP to 9k, well below the default protocol limits in the libc
rpc code.  This change simply removes these introduced limits, falling
back on the libc definitions.

PR:		88856
Reported by:	Keith Bostic <bostic at sleepycat dot com>
Testing by:	Susan LoVerso <sue at loverso dot southborough dot ma dot us>
Reveiwed by:	cel, rees
Review timeout:	alfred, mbr
MFC after:	2 weeks
2006-05-17 23:18:17 +00:00
David Malone
e390e3af7c Use ANSI definitions.
Avoid using extern by declaring shared functions in header files.
Const poision.
2005-11-13 21:17:24 +00:00
Stefan Farfeleder
1e72f11f56 Use socklen_t variables when passing sizes to getsockname() and
getsockopt().
2005-09-02 19:33:50 +00:00
Stefan Farfeleder
adcd73865c Fix a syntax error in the generated code when invoked with -P. Note that
the generated code still doesn't compile as we lack tinfo, t_getinfo and
friends.
2005-09-02 18:20:47 +00:00
Stefan Farfeleder
896cdc310c Stop generating the `register' keyword. 2005-09-02 10:32:05 +00:00
Stefan Farfeleder
15df5e2d43 Don't generate K&R C code. The -C flag is kept for backwards compatibility.
Also remove the SIG_PF macro, there is no need to cast closedown.
2005-09-02 10:23:26 +00:00
Stefan Farfeleder
d0cc804bba - Use prototypes in headers.
- Include rpc_scan.h before rpc_util.h for the tok_kind enum.
- Nuke unused declarations.
2005-08-31 20:45:15 +00:00
Stefan Farfeleder
63f1737128 Move #ident into #if 0. 2005-05-31 20:00:29 +00:00
Martin Blapp
bcb53b1606 Implement nonblocking tpc-connections. rpcgen -m does still
produce backcompatible code.

Reviewed by:	rwatson
Obtained from:	NetBSD
MFC after:	1 day
2003-01-16 07:27:30 +00:00
Philippe Charnier
75863a6dbb Removal of spaces at EOL. Add __FBSDID. New function xmalloc, xrealloc,
xstrdup. There is a crash() function that do cleaning before exiting the
program. The new functions are wrappers that make use of crash() in case
of allocation failure. warn, exit -> err.

Reviewed by:	alfred
2002-07-21 12:55:04 +00:00
Alfred Perlstein
40ad88851b - TI-RPC is now the default again for code generation.
- As before, inetd support support is turned of per default.
  Code for inetd can be made with -I.

- Support for ``transport monitors'' and the NLSPROVIDER env
  variable is still there , even if their use is not clear in
  non TLI stream based systems like Free-/NetBSD. It can be activated
  with -P.

- There are a few corrections in rpcgen.1 and usage function to conform
  to the code. Added and documented -P

- I removed the #ifdefs checks for Free-/NetBSD since we are the only
  ones who use this code. MaxOS X may have the same limitations as
  we have, so this code will correctly build for them.

- Generate correct cflags.

Submitted by: mbr, Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
PR: bin/29175, misc/27816
2002-07-14 17:54:00 +00:00
Dag-Erling Smørgrav
7dac28cfc3 Back out part of previous commit - K&R doesn't have const. 2002-05-09 11:24:58 +00:00
Dag-Erling Smørgrav
0081eff379 Make _msgout take a const char * rather than a char *.
Sponsored by:	DARPA, NAI Labs
2002-05-08 14:50:28 +00:00
Warner Losh
d3cb5ded92 remove __P 2002-03-22 01:33:25 +00:00
Kris Kennaway
c0e30a2b1f Embed $FreeBSD$ as an rcsid[] 2001-07-19 01:39:12 +00:00
Kris Kennaway
69c828c6bc Don't generate syslog() statements which have format string vulnerabilities.
MFC after:	1 week
2001-07-05 08:17:41 +00:00
Alfred Perlstein
8360efbd6c Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

  Bring in required TLI library routines to support this.

  Since we don't support TLI we've essentially copied what NetBSD
  has done, adding a thin layer to emulate direct the TLI calls
  into BSD socket calls.

  This is mostly from Sun's tirpc release that was made in 1994,
  however some fixes were backported from the 1999 release (supposedly
  only made available after this porting effort was underway).

  The submitter has agreed to continue on and bring us up to the
  1999 release.

  Several key features are introduced with this update:
    Client calls are thread safe. (1999 code has server side thread
    safe)
    Updated, a more modern interface.

  Many userland updates were done to bring the code up to par with
  the recent RPC API.

  There is an update to the pthreads library, a function
  pthread_main_np() was added to emulate a function of Sun's threads
  library.

  While we're at it, bring in NetBSD's lockd, it's been far too
  long of a wait.

  New rpcbind(8) replaces portmap(8) (supporting communication over
  an authenticated Unix-domain socket, and by default only allowing
  set and unset requests over that channel). It's much more secure
  than the old portmapper.

  Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
  to support TI-RPC and to support IPV6.

  Umount(8) is also fixed to unmount pathnames longer than 80 chars,
  which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul
2001-03-19 12:50:13 +00:00
Bruce Evans
c513aafea1 Fixed printf format errors. 1998-08-02 15:18:45 +00:00
Jordan K. Hubbard
526195ad0d General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 19:08:36 +00:00
Bill Paul
ff49530f45 Clean up. (I hope I'm doing this right.)
Update rpcgen with the one from the TI-RPC 2.3 distribution.

Note that when built for FreeBSD, this version of rpcgen assumes
backwards compatibility mode by default. This means that it will produce
ONCRPC 4.0 compatible code unless otherwise instructed, instead of the
other way around.

One incompatibility has also been worked around: this rpcgen normally
always emits an '#include <stropts.h>' directive whether you select
backwards compatibility mode or not. We don't have STREAMS, so this
behavior has been changed: now it will only emit this line if run in TI-RPC
mode.

The 'generate output files in current directory instead of the
directory where the protocol definition file lives' hack from the
original rpcgen has been preserved.

Notable new features:

- Can be used to generate RPC servers that can be launched
  from port monitors such as inetd(5).

- Can generate ANSI C code.

- Can generate sample client and server top-level programs and
  makefiles in addition to the usual client and server stubs.

- Can generate inline XDR routines.
1995-12-13 03:31:10 +00:00
Rodney W. Grimes
7799f52a32 Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
Nate Williams
5ec07232b9 Fix rpcgen so that generated files are written to the current working
directory (instead of the same directory as the source files) and that
#includes in those files do not contain the path to the source file.

Obtained from: J.T. Conklin via NetBSD
1995-03-04 17:47:50 +00:00
Garrett Wollman
4e115012be Move RPC stub generator program over from 1.1.5.
Submitted by:	Original work in 1.x by J. T. Conklin.
1994-08-07 18:01:39 +00:00