oweals/cde.git
12 years agoFreeBSD updates for dtspcd, dtfile and others
Marcin Cieslak [Wed, 15 Aug 2012 17:46:03 +0000 (19:46 +0200)]
FreeBSD updates for dtspcd, dtfile and others

* Add libraries where necesary
* Point to Freetype2 includes for dtfile
* Define default manpath

12 years agomp_session: Always use global displayname
Frederic Koehler [Wed, 15 Aug 2012 01:49:14 +0000 (21:49 -0400)]
mp_session: Always use global displayname

This code tried to automatically generate the X DISPLAY
from the combination of the hostname and display number;
however 127.0.0.1:0 is normally rejected by X11, so this
technique is no good. Fixes dticon hang on startup, caused by
XOpenDisplay failure leading to this message from tttrace:
tt_default_session_set(0x0x875190=="X 127.0.0.1 0") = 1032 (TT_ERR_ACCESS)

12 years agoconst char maze: unbreak ToolTalk build
Marcin Cieslak [Wed, 15 Aug 2012 02:07:01 +0000 (04:07 +0200)]
const char maze: unbreak ToolTalk build

Follow up to de82eebdd56c02ae200bf2d9ec60df053919e7e7

12 years agoUse $(KORNSHELL) for dtksh as well
Marcin Cieslak [Wed, 15 Aug 2012 01:45:39 +0000 (03:45 +0200)]
Use $(KORNSHELL) for dtksh as well

This commit updates master at de82eebdd56c02ae200bf2d9ec60df053919e7e7
to include bits from

   Message-Id: <1344951117-33716-3-git-send-email-saper@saper.info>
   http://thread.gmane.org/gmane.comp.desktop.cde.devel/283/focus=301

not included in the

   Message-Id: <1344951117-33716-1-git-send-email-saper@saper.info>
   http://thread.gmane.org/gmane.comp.desktop.cde.devel/283/focus=299

that was commited as d3206f451496035dbd5db5ed62a95e67e499c712

Also remove two generated files from the repository:
programs/dtksh/ksh93/man/man1/sh.1
programs/dtksh/ksh93/man/man3/nval.3

Conflicts:

cde/programs/dtksh/ksh93/Imakefile

12 years agoDeal with *.tmp.msg after mkcatdefs failure
Marcin Cieslak [Wed, 15 Aug 2012 01:30:48 +0000 (03:30 +0200)]
Deal with *.tmp.msg after mkcatdefs failure

BSD make interrupts shell pipeline after
if it cannot run the command:

rm -f Mrm.msg
ln -s ../../../../imports/motif/localized/de_DE.ISO8859-1/msg/Mrm.msg Mrm.msg
Running mkcatdefs for Mrm.cat with LANG set to de_DE.ISO8859-1
(  rm -f Mrm.cat Mrm.tmp.msg;  LANG=de_DE.ISO8859-1;  export LANG;  ../../../../imports/motif/localized/util/mkcatdefs Mrm Mrm.msg -h > Mrm.tmp.msg;  gencat  Mrm.cat Mrm.tmp.msg;  rm -f Mrm.tmp.msg  )
../../../../imports/motif/localized/util/mkcatdefs: not found
*** Error code 127

After this, an empty Mrm.tmp.msg is left.

12 years agoHave to pass a const char * to function expecting char * here, otherwise it fails...
Chris Wareham [Tue, 14 Aug 2012 11:59:44 +0000 (12:59 +0100)]
Have to pass a const char * to function expecting char * here, otherwise it fails to link thanks to the declaration of a stub wth non-const param.

12 years agoFix most of the following classes of warnings in the ToolTalk libraries:
Chris Wareham [Tue, 14 Aug 2012 10:49:53 +0000 (11:49 +0100)]
Fix most of the following classes of warnings in the ToolTalk libraries:

- Const strings referenced by non-const variables.
- Incorrect format specifers for printing addresses
- Unused variables
- Signed comparison to unsigned

Also fix an incorrect enumeration value in a switch statement.

12 years agoUse $(SHELL) and $(KORNSHELL) for shell scripts
Marcin Cieslak [Tue, 14 Aug 2012 13:31:56 +0000 (15:31 +0200)]
Use $(SHELL) and $(KORNSHELL) for shell scripts

Introduce KORNSHELL make variable to point
to the implementation of the Korn Shell.

Use $(SHELL) or $(KORNSHELL) explicitly for
make programs that do not automatically call
shell scripts from the current directory.

12 years agoCompile dtksh on FreeBSD
Marcin Cieslak [Tue, 14 Aug 2012 13:31:55 +0000 (15:31 +0200)]
Compile dtksh on FreeBSD

dtksh can be now compiled on FreeBSD. Work in progress.

Needs a real Korn shell to bootstrap as $(KSHELL).
KSHELL is set by default to /usr/local/bin/ksh93
(generic POSIX shell may not work)

Tested on:

  FreeBSD 9.0-BETA1 #0 r224912M amd64

Known issues:

xvmstat:
* sleep does not work well (SIGSTOP is delivered)
xpong:
* xpong: line 220:  ball1x = max_x * 2.2 / 3 : arithmetic syntax error
* dtksh is rebuilt uncondtionally every time make is invoked

12 years agoconfigRun.src: remove -s from inetd cmd, only run inetd if it exists.
ibid_ag@lavabit.com [Tue, 14 Aug 2012 03:14:09 +0000 (21:14 -0600)]
configRun.src: remove -s from inetd cmd, only run inetd if it exists.

12 years agoFreeBSD port: dtsearch, dtterm, dtwidget, dthelp
Marcin Cieslak [Mon, 13 Aug 2012 15:57:16 +0000 (17:57 +0200)]
FreeBSD port: dtsearch, dtterm, dtwidget, dthelp

FreeBSD portability of dtsearch, dtterm, dtwidget, dthelp

Work in progress for dtlogin and dtmail

12 years agodtbuilder: manually fix up istr.h (from Pascal) since the broken patch had already...
Jon Trulson [Tue, 14 Aug 2012 01:48:57 +0000 (19:48 -0600)]
dtbuilder: manually fix up istr.h (from Pascal) since the broken patch had already been reverted.

12 years agoWIP to make dtbuilder work on 64bit.
Pascal Stumpf [Mon, 13 Aug 2012 15:35:34 +0000 (17:35 +0200)]
WIP to make dtbuilder work on 64bit.

Fixes many, though not all 64bit-warnings.  In lots of places, pointers are
cast to ints to be then used as array subscripts.  The only way to deal with
this is to change them to long.  Additionally, use calloc() to allocate the
int_array in istr.c and drop the (wrong) macro patch to istr.h.  Should make
dtbuilder work on 32bit again.

12 years agolib/csa: Use ANSI C prototypes
Marcin Cieslak [Mon, 13 Aug 2012 10:10:37 +0000 (12:10 +0200)]
lib/csa: Use ANSI C prototypes

Improve type compatibility and enable
ANSI C prototypes.

12 years agoCast registerrpc args to xdrproc_t explicitly
Marcin Cieslak [Mon, 13 Aug 2012 10:08:04 +0000 (12:08 +0200)]
Cast registerrpc args to xdrproc_t explicitly

Fixes:
agent.c: In function '_DtCm_init_agent':
agent.c:160: warning: passing argument 5 of 'registerrpc' from incompatible pointer type
agent.c:160: warning: passing argument 6 of 'registerrpc' from incompatible pointer type
agent.c:167: warning: passing argument 5 of 'registerrpc' from incompatible pointer type
agent.c:167: warning: passing argument 6 of 'registerrpc' from incompatible pointer type

12 years agoNULL is a pointer, not string terminator
Marcin Cieslak [Mon, 13 Aug 2012 10:08:03 +0000 (12:08 +0200)]
NULL is a pointer, not string terminator

Replace some instances of NULL to '\0', when
referring to string terminator.

12 years agoRevert "At least on OpenBSD/amd64, this macro returns a bogus value if its argument...
Jon Trulson [Tue, 14 Aug 2012 00:18:52 +0000 (18:18 -0600)]
Revert "At least on OpenBSD/amd64, this macro returns a bogus value if its argument is NULL."

This reverts commit 0d2f7866ac676ab0f3c8ac3eabcec06f580a9d62.

This causes great mayhem in building/generating dtbuilder .msg files
(corrupting them, and inserting '(nil)' all over the place).

These would cause dtbuilder, and any other program built by dtcodegen
to have screwed up colors, missing callbacks and other mayhem.

This was confirmed by others on the list - reverting this made those
issues go away.

It may be that the int -> long is correct, but the NULL check
certainly does not seem to do what was intended.  I'll leave it up to
Pascal to investigate :)

12 years agoCompile ToolTalk on FreeBSD
Marcin Cieslak [Mon, 13 Aug 2012 02:01:47 +0000 (04:01 +0200)]
Compile ToolTalk on FreeBSD

Fix const correctness problems with OPT_CONST_CORRECT:

tt_xdr_utils.C: In constructor '_Tt_xdr_size_stream::_Tt_xdr_size_stream()':
tt_xdr_utils.C:150: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, long int*)' to 'bool_t (*)(__rpc_xdr*, const long int*)'
tt_xdr_utils.C:151: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, char*, unsigned int)' to 'bool_t (*)(__rpc_xdr*, const char*, u_int)'
tt_xdr_utils.C:159: error: invalid conversion from 'bool_t (*)(__rpc_xdr*, char*, unsigned int)' to 'bool_t (*)(__rpc_xdr*, const char*, u_int)'

tt_entry_pt.C: In function '_Tt_string _tt_entrypt_to_string(_Tt_entry_pt)':
tt_entry_pt.C:455: error: conversion from 'long int' to '_Tt_string' is ambiguous
../../lib/util/tt_string.h:104: note: candidates are: _Tt_string::_Tt_string(int)
../../lib/util/tt_string.h:102: note:                 _Tt_string::_Tt_string(const char*)

12 years agoSkip building m-guides and dtksh for FreeBSD
Marcin Cieslak [Mon, 13 Aug 2012 02:01:46 +0000 (04:01 +0200)]
Skip building m-guides and dtksh for FreeBSD

12 years agoImprove creation of shared libraries for FreeBSD
Marcin Cieslak [Mon, 13 Aug 2012 02:01:45 +0000 (04:01 +0200)]
Improve creation of shared libraries for FreeBSD

12 years agoAdjust cpp location for FreeBSD
Marcin Cieslak [Sun, 12 Aug 2012 22:37:42 +0000 (00:37 +0200)]
Adjust cpp location for FreeBSD

cpp was removed from /usr/libexec with FreeBSD 5.0-RELEASE.
Use __FreeBSD_version to tell imake if it's still there.

While here, X.Y.Z versioning ended with FreeBSD 3.0, so
we must be dealing with 2.Y.Z when checking for -lgnumalloc.

12 years agoFix broken linux builds caused by recent DtHelp/Imakefile jpeg change
Jon Trulson [Sun, 12 Aug 2012 23:31:28 +0000 (17:31 -0600)]
Fix broken linux builds caused by recent DtHelp/Imakefile jpeg change

A patch from Pascal Stumpf using external jpeg broke linux builds,
since libjpeg needs to be linked in when using a remote jpeg lib.

So, in lnxLib.tmpl, define SharedDtHelpReqs so -ljpeg is used.  Also,
in DtHelp/Imakefile, use proper Arch defines so external jpeg libs are
only used on linux, fbsd, and obsd systems.

12 years agosome tweaks for configRun: add -h/--usage option, use portable print instead of echo...
Douglas Mencken [Sun, 12 Aug 2012 21:13:36 +0000 (15:13 -0600)]
some tweaks for configRun: add -h/--usage option, use portable print instead of echo \c, etc.

12 years agodtcreate: check for TT_ERR_PTYPE the correct way
William Schaub [Sun, 12 Aug 2012 20:24:36 +0000 (16:24 -0400)]
dtcreate: check for TT_ERR_PTYPE the correct way

12 years agoUse cpp -traditional.
Pascal Stumpf [Sun, 12 Aug 2012 17:33:25 +0000 (19:33 +0200)]
Use cpp -traditional.

StandardCppOptions do not get respected here, so change the default CppCmd
to cpp -traditional like for FreeBSD.  Helps kill a few warnings.

12 years agosym2num: add path to cpp on OpenBSD.
Pascal Stumpf [Sun, 12 Aug 2012 19:27:19 +0000 (21:27 +0200)]
sym2num: add path to cpp on OpenBSD.

12 years agoLow-hanging fruit: Fix most warnings in lib/DtSearch.
Pascal Stumpf [Sun, 12 Aug 2012 16:51:53 +0000 (18:51 +0200)]
Low-hanging fruit: Fix most warnings in lib/DtSearch.

Most of these are related to missing includes and prototypes as well as
parens/braces.  A few are also potential 64bit issues.

12 years agoGet rid of malloc.h.
Pascal Stumpf [Sun, 12 Aug 2012 14:41:42 +0000 (16:41 +0200)]
Get rid of malloc.h.

This is a non-POSIX/ISO-C header.  It is ok to include this on Linux, but it
is obsolete on BSD; FreeBSD even throws an error if you include it with
__STDC__ defined.  Every system should nowadays have malloc() defined in
stdlib.h.

Diff is largely mechanical, replacing malloc.h with stdlib.h where it is not
yet included anyway.

12 years agoDo not use the PID as a way of generating a "random" filename.
Pascal Stumpf [Sun, 12 Aug 2012 18:27:32 +0000 (20:27 +0200)]
Do not use the PID as a way of generating a "random" filename.

This script did not even check for the file's existence prior to cat'ing
random stuff into it.  Ouch.

12 years agoDo not use internal libjpeg.
Pascal Stumpf [Sun, 12 Aug 2012 13:25:22 +0000 (15:25 +0200)]
Do not use internal libjpeg.

Nowadays, OpenMotif is itself linked to libjpeg, so pulling in another
version of it causes symbol size mismatches, not to mention the maintenance
burden and security implications arising from keeping our own copy of libjpeg.

We still need some of the header files provided here because they are internal
to libjpeg and not installed on most distributions.

12 years agodtmail actually does work now on OpenBSD due to other changes.
Pascal Stumpf [Sun, 12 Aug 2012 20:20:36 +0000 (14:20 -0600)]
dtmail actually does work now on OpenBSD due to other changes.

12 years agotooltalk: Fix bad assumptions about sizeof(uid_t)
Frederic Koehler [Sun, 12 Aug 2012 06:12:28 +0000 (02:12 -0400)]
tooltalk: Fix bad assumptions about sizeof(uid_t)

In part of the tooltalk rpc code (mp_message.c), it was assumed that on
the majority of platforms, sizeof(uid_t)=sizeof(gid_t)=sizeof(long).  On
Linux-x64, uid_t is an unsigned int, which makes the code fail: all
tooltalk messages fail to send with an RPC_CANTENCODEARGS at the
rpc-level, and TT_INTERNAL_ERR for the actual program.  We instead
change the code to explicitly examine sizeof(uid_t) to see whether it is
int or long sized. This allows tooltalk-dependent functinoality
like logout and multiple calls to dtfile to work.

12 years agott (tooltalk): Kill some warnings
Frederic Koehler [Sat, 11 Aug 2012 22:38:59 +0000 (18:38 -0400)]
tt (tooltalk): Kill some warnings

Includes some potentially bad pointer/int conversions

12 years agotttrace: Fix bad usage of va_arg with enums
Frederic Koehler [Sat, 11 Aug 2012 21:15:39 +0000 (17:15 -0400)]
tttrace: Fix bad usage of va_arg with enums

Enums may be represented with a smaller type than int; however, they are
automatically promoted to int when passed in va_arg lists, just as
short, char, etc. are. GCC thus "knows" that you never want to call
va_arg with an enum type, and instead inserts an abort.

12 years agoPatches for dtscreen, dtsearchpath, dtsession on OBSD.
Pascal Stumpf [Sat, 11 Aug 2012 12:04:50 +0000 (14:04 +0200)]
Patches for dtscreen, dtsearchpath, dtsession on OBSD.

Do not redefine round(3), and provide a manpath for OpenBSD.
(this is one of the few things that need to be adjusted for other BSDs)

12 years agoOpenBSD patches for ttsnoop.
Pascal Stumpf [Sat, 11 Aug 2012 12:12:47 +0000 (14:12 +0200)]
OpenBSD patches for ttsnoop.

Mostly adding std:: for strstream interfaces.

12 years agoOpenBSD patches for dtpdmd and dtprintinfo.
Pascal Stumpf [Sat, 11 Aug 2012 12:01:14 +0000 (14:01 +0200)]
OpenBSD patches for dtpdmd and dtprintinfo.

Casts, #ifdefs, SIGCLD ...

12 years agoOpenBSD #ifdefs for imake templates for localisations.
Pascal Stumpf [Sat, 11 Aug 2012 12:08:03 +0000 (14:08 +0200)]
OpenBSD #ifdefs for imake templates for localisations.

12 years agoMake nsgmls compile on OpenBSD.
Pascal Stumpf [Sat, 11 Aug 2012 12:09:40 +0000 (14:09 +0200)]
Make nsgmls compile on OpenBSD.

As far as I can tell, the duplicate instantiations from entmgr_inst.m4 are
unnecessary and only cause compile failures without -fpermissive.

12 years agoCurrent state of my dtmail work.
Pascal Stumpf [Sat, 11 Aug 2012 11:57:26 +0000 (13:57 +0200)]
Current state of my dtmail work.

Mostly #ifdefs and casts; also, do not redefine strcasestr().  This will
probably be needed for Linux too when compiling without -fpermissive.

12 years agoMake dtlogin compile on OpenBSD.
Pascal Stumpf [Sat, 11 Aug 2012 11:49:07 +0000 (13:49 +0200)]
Make dtlogin compile on OpenBSD.

Most importantly, we *cannot* do the utmp stuff this code is attempting.
It is SysV-specific.

12 years agoMake dtinfo work on OpenBSD.
Pascal Stumpf [Sat, 11 Aug 2012 11:43:57 +0000 (13:43 +0200)]
Make dtinfo work on OpenBSD.

strstream.h is now called "strstream" and is obsolete, but use it anyway until
all code is converted over.  This also needs std:: added, at least for GCC
4.2.1.  Lastly, when hardcoding the path to perl, /usr/bin/perl should be used
rather than anything else.

12 years agoOpenBSD patches for dtcalc, dtdocbook, dthelp and dtimsstart.
Pascal Stumpf [Sat, 11 Aug 2012 11:38:22 +0000 (13:38 +0200)]
OpenBSD patches for dtcalc, dtdocbook, dthelp and dtimsstart.

12 years agodtcreate: Fix double free inside ProcessExecString()
William Schaub [Sat, 11 Aug 2012 18:46:35 +0000 (14:46 -0400)]
dtcreate: Fix double free inside ProcessExecString()

12 years agodtcreate: fix exit with TT_ERR_PTYPE and fix several sprintf related segfaults.
William Schaub [Sat, 11 Aug 2012 08:02:17 +0000 (04:02 -0400)]
dtcreate: fix exit with TT_ERR_PTYPE and fix several sprintf related segfaults.

12 years agore-enable building of dtmail, except on OpenBSD
Jon Trulson [Sun, 12 Aug 2012 01:26:04 +0000 (19:26 -0600)]
re-enable building of dtmail, except on OpenBSD

12 years agoImakefile diffs for OpenBSD.
Pascal Stumpf [Thu, 9 Aug 2012 20:06:51 +0000 (22:06 +0200)]
Imakefile diffs for OpenBSD.

12 years agoimake: Convert function prototypes and signatures to ANSI format.
Chris Wareham [Fri, 10 Aug 2012 13:48:56 +0000 (14:48 +0100)]
imake: Convert function prototypes and signatures to ANSI format.

12 years agoFixes for dtfile on OpenBSD, plus missing prototypes. Use statfs() on BSD to find...
Pascal Stumpf [Fri, 10 Aug 2012 13:09:04 +0000 (15:09 +0200)]
Fixes for dtfile on OpenBSD, plus missing prototypes. Use statfs() on BSD to find out if a file system is NFS.

12 years agoOpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD...
Pascal Stumpf [Fri, 10 Aug 2012 12:44:57 +0000 (14:44 +0200)]
OpenBSD fixes for dtcm. There are no global "timezone" and "tzname" symbols on BSD. Apart from that, mainly #ifdefs.

12 years agoOpenBSD fixes for DtWidget, dtaction, dtappbuilder.
Pascal Stumpf [Fri, 10 Aug 2012 12:35:23 +0000 (14:35 +0200)]
OpenBSD fixes for DtWidget, dtaction, dtappbuilder.

12 years agoAllow dtterm to at least allocate a pty on OpenBSD. Display is still mangled, however...
Pascal Stumpf [Fri, 10 Aug 2012 12:29:28 +0000 (14:29 +0200)]
Allow dtterm to at least allocate a pty on OpenBSD. Display is still mangled, however, and it frequently crashes (64bit issue).

12 years agoOpenBSD fixes for lib/DtTerm: values.h, #ifdef's and some constants that are not...
Pascal Stumpf [Thu, 9 Aug 2012 21:53:47 +0000 (23:53 +0200)]
OpenBSD fixes for lib/DtTerm: values.h, #ifdef's and some constants that are not defined on BSD. Also, leave out utmp stuff that does not work on BSD. Note that this terminal allocation does not work properly yet, but this will be fixed later.

12 years agohistorical: mv some old files that we want to preserve out of the top level
Jon Trulson [Fri, 10 Aug 2012 13:17:27 +0000 (07:17 -0600)]
historical: mv some old files that we want to preserve out of the top level

Some of these older files just clutter up things and do not contribute
much information that is not historical in nature, so preserve them
in an out of the way location.

12 years agoTooltalk fixes for OpenBSD. This consists mainly of #ifdefs, casts and some small...
Pascal Stumpf [Fri, 10 Aug 2012 12:07:06 +0000 (14:07 +0200)]
Tooltalk fixes for OpenBSD. This consists mainly of #ifdefs, casts and some small type nits.

12 years agoOpenBSD fixes for DtPrint and csa.
Pascal Stumpf [Fri, 10 Aug 2012 12:02:30 +0000 (14:02 +0200)]
OpenBSD fixes for DtPrint and csa.

12 years agoNew top level README from Christopher Turkel <turkelchris@aol.com>
Jon Trulson [Fri, 10 Aug 2012 12:09:53 +0000 (06:09 -0600)]
New top level README from Christopher Turkel <turkelchris@aol.com>

12 years agodtwm: Cleanup some implicit definitions
Frederic Koehler [Thu, 9 Aug 2012 21:11:11 +0000 (17:11 -0400)]
dtwm: Cleanup some implicit definitions

Mostly this is adding appropriate #includes and declarations,
but for WmImage.c we also change from using the proper name
for XmeGetMask, rather than the identical but renamed
version _DtGetMask which is not exported in any header.

12 years agoOpenBSD fixed for lib/DtSvc.
Pascal Stumpf [Thu, 9 Aug 2012 20:51:52 +0000 (22:51 +0200)]
OpenBSD fixed for lib/DtSvc.

12 years agoSIGPWR is not present everywhere.
Pascal Stumpf [Thu, 9 Aug 2012 20:04:52 +0000 (22:04 +0200)]
SIGPWR is not present everywhere.

12 years agoOpenBSD.cf, from Pascal Stumpf
Jon Trulson [Fri, 10 Aug 2012 11:37:12 +0000 (05:37 -0600)]
OpenBSD.cf, from Pascal Stumpf

12 years agoProvide support for installation under OpenBSD. Don't override PATH in the install...
Pascal Stumpf [Thu, 9 Aug 2012 19:57:47 +0000 (21:57 +0200)]
Provide support for installation under OpenBSD. Don't override PATH in the install script, it may hide needed tools, and the location of these binaries is highly OS-dependent anyway.

Also, allow overriding some variables in the install script.

12 years agorecognise OpenBSD version
Pascal Stumpf [Thu, 9 Aug 2012 19:52:26 +0000 (21:52 +0200)]
recognise OpenBSD version

12 years agoRename getline() to not conflict with the standard POSIX interface of the same name.
Pascal Stumpf [Thu, 9 Aug 2012 19:35:12 +0000 (21:35 +0200)]
Rename getline() to not conflict with the standard POSIX interface of the same name.

12 years agoRemove ambiguity in string compare.
James Woodcock [Thu, 9 Aug 2012 19:59:32 +0000 (20:59 +0100)]
Remove ambiguity in string compare.

12 years agoRemove unnecessary extern modifier on struct declarations.
James Woodcock [Thu, 9 Aug 2012 19:37:27 +0000 (20:37 +0100)]
Remove unnecessary extern modifier on struct declarations.

12 years ago"ISO C++ forbids declaration of [X] with no type" warning fixes.
James Woodcock [Thu, 9 Aug 2012 19:11:08 +0000 (20:11 +0100)]
"ISO C++ forbids declaration of [X] with no type" warning fixes.

12 years agoMerge branch 'master' of ssh://git.code.sf.net/p/cdesktopenv/code
Jon Trulson [Thu, 9 Aug 2012 18:56:25 +0000 (12:56 -0600)]
Merge branch 'master' of ssh://git.code.sf.net/p/cdesktopenv/code

12 years agoUse socklen_t where available.
Jon Trulson [Thu, 9 Aug 2012 18:27:58 +0000 (12:27 -0600)]
Use socklen_t where available.

Patch from <Pascal.Stumpf@cubes.de>

This should use socklen_t where available, really ...

12 years agoUse SIGCHLD rather than SIGCLD.
Jon Trulson [Thu, 9 Aug 2012 18:24:56 +0000 (12:24 -0600)]
Use SIGCHLD rather than SIGCLD.

Patch from Pascal Stumpf <Pascal.Stumpf@cubes.de>

The official POSIX name for this signal is SIGCHLD.  Linux probably
has SIGCLD only for SysV compatibility, but BSD does not.

12 years agoAt least on OpenBSD/amd64, this macro returns a bogus value if its argument is NULL.
Jon Trulson [Thu, 9 Aug 2012 18:21:43 +0000 (12:21 -0600)]
At least on OpenBSD/amd64, this macro returns a bogus value if its argument is NULL.

Patch from Pascal Stumpf <Pascal.Stumpf@cubes.de>

So check for this first like the other macros in this file do, and
don't cast an istring to int.

12 years agoDeal with the fact that modern compilers assume different scoping rules
Jon Trulson [Thu, 9 Aug 2012 18:18:30 +0000 (12:18 -0600)]
Deal with the fact that modern compilers assume different scoping rules

Patch from Pascal Stumpf <Pascal.Stumpf@cubes.de>:

So here are all the patches that deal with the fact that modern
compilers assume different scoping rules for variables declared in for
loops.  On Linux, -fpermissive has been added as a compiler flag to
compensate for this old C code, but I think it is the wrong approach.

Sorry, couldn't help sneaking in a || defined(CSRG_BASED) and some casts
needed for other reasons ...

12 years agoThis adds the basic config bits needed for OpenBSD.
Jon Trulson [Thu, 9 Aug 2012 18:11:13 +0000 (12:11 -0600)]
This adds the basic config bits needed for OpenBSD.

Patch from Pascal Stumpf <Pascal.Stumpf@cubes.de>

Most is just copied from the existing imake installation in
/usr/X11R6.  Additionally:

* Allow overriding CDESharedRev, X11ProjectRoot and ProjectRoot
* Add a new define to be able to override MINCLUDESRC too

(this allows me to build CDE without symlinking any include directories)

12 years agoFix more sprintf calls.
Marc Balmer [Thu, 9 Aug 2012 05:38:39 +0000 (07:38 +0200)]
Fix more sprintf calls.

12 years agoBuild with debug symbols enabled.
Marc Balmer [Thu, 9 Aug 2012 05:03:46 +0000 (07:03 +0200)]
Build with debug symbols enabled.

12 years agoUse a more robust idiom When converting sprintf() to snprintf()
Marc Balmer [Thu, 9 Aug 2012 05:08:05 +0000 (07:08 +0200)]
Use a more robust idiom When converting sprintf() to snprintf()

don't use the idiom

char foo[BUFSIZ];
snprintf(foo, BUFSIZ, ....);

but

char foo[BUFSIZ];
snprintf(foo, sizeo foo, ....);

because this will automatically catch situations where the size of foo
is later changed, e.g. like  foo[BUFSIZ + 8];

Fix another use of sprintf.

12 years agoFix for dtmail execution group error
Adam Robinson [Thu, 9 Aug 2012 03:22:03 +0000 (20:22 -0700)]
Fix for dtmail execution group error

12 years agodtscreen: include stdlib to avoid exit redeclaration
Robert Tomsick [Thu, 9 Aug 2012 03:10:01 +0000 (23:10 -0400)]
dtscreen: include stdlib to avoid exit redeclaration

Signed-off-by: Robert Tomsick <robert@tomsick.net>
12 years agodtscreen: include stdlib where appropriate
Robert Tomsick [Thu, 9 Aug 2012 03:10:02 +0000 (23:10 -0400)]
dtscreen: include stdlib where appropriate

Signed-off-by: Robert Tomsick <robert@tomsick.net>
12 years agodthelpview: Util.c include stdlib to avoid redeclaring exit()
Robert Tomsick [Thu, 9 Aug 2012 02:42:17 +0000 (22:42 -0400)]
dthelpview: Util.c include stdlib to avoid redeclaring exit()

Signed-off-by: Robert Tomsick <robert@tomsick.net>
12 years agodthelpview: Main.c - Cleanup variable init
Robert Tomsick [Thu, 9 Aug 2012 02:42:16 +0000 (22:42 -0400)]
dthelpview: Main.c - Cleanup variable init

Signed-off-by: Robert Tomsick <robert@tomsick.net>
12 years agodtcalc: warning prevention, add <stdlib.h> include for prototype of free()
Peter Howkins [Thu, 9 Aug 2012 11:08:46 +0000 (12:08 +0100)]
dtcalc: warning prevention, add <stdlib.h> include for prototype of free()

12 years agodtcalc: warning prevention, do not use NULL when you mean 0.
Peter Howkins [Thu, 9 Aug 2012 11:07:53 +0000 (12:07 +0100)]
dtcalc: warning prevention, do not use NULL when you mean 0.

12 years agodtaction: Fix unsafe use of sprintf
Jon Trulson [Thu, 9 Aug 2012 02:17:17 +0000 (20:17 -0600)]
dtaction: Fix unsafe use of sprintf

Patch from Robert Tomsick <robert+cde@tomsick.net>:

I believe this fixes vulnerability #3 from CERT CA-1999-11.[1]  The other
uses of sprintf in DtAction seem to be safe.

[1] https://www.cert.org/advisories/CA-1999-11.html

12 years agodtterm - minor warning fixes
Jon Trulson [Thu, 9 Aug 2012 02:09:40 +0000 (20:09 -0600)]
dtterm - minor warning fixes

Patch by Robert Tomsick <robert+cde@tomsick.net>

12 years agoDtSvc: Fixes a segfault on Debian squeeze 64 bit and most probably other systems...
Jon Trulson [Wed, 8 Aug 2012 18:45:40 +0000 (12:45 -0600)]
DtSvc: Fixes a segfault on Debian squeeze 64 bit and most probably other systems, too.

Patch from Marc Balmer <marc@msys.ch>:

Use strlen, not sizeof, here.  Fixes a segfault on Debian squeeze 64 bit
and most probably other systems, too.

12 years agolibtt: "%wc" is Microsoft extension, not supported in every Std C Library.
Jon Trulson [Wed, 8 Aug 2012 18:35:49 +0000 (12:35 -0600)]
libtt: "%wc" is Microsoft extension, not supported in every Std C Library.

Patch from Douglas Mencken <dougmencken@gmail.com>:

"%wc" is Microsoft extension, not supported in every Std C Library. So
if we don't want to print "%wc%wc%wc%wc%..." instead of real chars, we
shall not use it.

Before:

%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wcession[28326]:
_Tt_s_session::s_init(): 1051 (TT_ERR_INTERNAL)!
%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wcession[28326]: waitpid():
No child processes
%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wc%wcession[28326]: child
ttsession exited with status 1

After:

/usr/dt/bin/ttsession[12397]: _Tt_s_session::s_init(): 1051 (TT_ERR_INTERNAL)!
/usr/dt/bin/ttsession[12397]: waitpid(): No child processes
/usr/dt/bin/ttsession[12397]: child ttsession exited with status 1

12 years agoDtSvc/dtwm: Fix some implicit declarations of functions by adding appropriate
Jon Trulson [Wed, 8 Aug 2012 17:47:18 +0000 (11:47 -0600)]
DtSvc/dtwm: Fix some implicit declarations of functions by adding appropriate

Patch from Frederic Koehler <f.koehler427@gmail.com>:

These implicit definitions cause segfaults on x64 because
the implicit return type is a 32-bit signed int, rather than a pointer
type.

12 years agodtwm: Define a final fallback for loading default window manager font
Jon Trulson [Wed, 8 Aug 2012 17:39:29 +0000 (11:39 -0600)]
dtwm: Define a final fallback for loading default window manager font

Patch from Frederic Koehler <f.koehler427@gmail.com>:

Define a final fallback for loading default window manager font;
before exiting, forcefully try to load "fixed" font. This is sufficient
to allow systems where fontList is set to an empty list to startup dtwm,
for now.

12 years agolibtt: Avoid an infinite loop in ttsession (tooltalk daemon) when /etc/mtab is a...
Jon Trulson [Wed, 8 Aug 2012 17:36:03 +0000 (11:36 -0600)]
libtt: Avoid an infinite loop in ttsession (tooltalk daemon) when /etc/mtab is a symlink, using lstat instead of stat.

Patch from Frederic Koehler <f.koehler427@gmail.com>

12 years agodtlogin: don't try to use /dev/mem to get random data on linux/bsd
Jon Trulson [Wed, 8 Aug 2012 05:22:44 +0000 (23:22 -0600)]
dtlogin: don't try to use /dev/mem to get random data on linux/bsd

dtlogin's genauth routines were trying to open and read /dev/mem on
linux and (presumably) bsd systems in order to obtain random data used
in creating an auth key.

This is bad for a variety of reasons.  Newer linux kernels (at least
on 3.2) issue the following warning to the kernel logs:

"Program dtlogin tried to access /dev/mem between 100000->102000."

Now on linux we will use /dev/urandom, and on CSRG_BASED (bsd) systems
we will use /dev/random to obtain some entropy.

12 years agodtdbcache: remove incorrect comment block and tmpnam_buf var (not used)
Jon Trulson [Tue, 7 Aug 2012 23:43:32 +0000 (17:43 -0600)]
dtdbcache: remove incorrect comment block and tmpnam_buf var (not used)

With Aaron's fixes to dtdbcache fixing a potential coredump, the
comment block in the write_db() function regarding tmpnam() no longer
applies, and the tmpnam_buf variable is no longer used.

So, remove them :)

12 years agodtdbcache: Remove old code in comments
Jon Trulson [Tue, 7 Aug 2012 22:56:11 +0000 (16:56 -0600)]
dtdbcache: Remove old code in comments

Patch from Aaron W. Hsu <arcfide@sacrideo.us>

12 years agodtdbcache: Use mkstemp() instead of tmpnam() to avoid bad interactions
Jon Trulson [Tue, 7 Aug 2012 22:52:26 +0000 (16:52 -0600)]
dtdbcache: Use mkstemp() instead of tmpnam() to avoid bad interactions

Patch from Aaron W. Hsu <arcfide@sacrideo.us>

12 years agoFix SIGSEGV while compiling dthelp on 64 bit systems.
Jon Trulson [Tue, 7 Aug 2012 04:42:34 +0000 (22:42 -0600)]
Fix SIGSEGV while compiling dthelp on 64 bit systems.

Patch from Ulrich Wilkens <mail@uwilkens.de>

I have a little patch for a problem that I found when I tried to
compile dthelp on 64bit FreeBSD. It could also be a problem on other
64bit systems.  The problem is that the program context compiles but
fails running with segmentation fault.

context uses the function m_malloc() which is missing a correct
prototype sometimes. Then it's treated to return int instead of void *
. On 64bit systems this cuts off the higher 32 bits because void * is
64bit whereas int is only 32bit.

12 years agoImake.cf/linux.cf: Add arm support.
Jon Trulson [Tue, 7 Aug 2012 04:38:54 +0000 (22:38 -0600)]
Imake.cf/linux.cf: Add arm support.

Patch from IRC user wschaub.

12 years agodtprintinfo: Fix SIGSEGV in dtprintinfo (passing NULL as first argument to catgets).
Jon Trulson [Mon, 6 Aug 2012 23:12:38 +0000 (17:12 -0600)]
dtprintinfo: Fix SIGSEGV in dtprintinfo (passing NULL as first argument to catgets).

Patch from Douglas Mencken <dougmencken@gmail.com>:

The issue is that MESSAGE tries to invoke catgets with NULL first
parameter, which is dereferenced inside catgets (Std C Library
function) without checking, from catgets.c source:

if (catalog->name_ptr[idx + 0] == (u_int32_t) set
          && catalog->name_ptr[idx + 1] == (u_int32_t) message)

On the other hand, there's a special value: -1 (cast to nl_catd),
which must be used instead of 0 (NULL) in the case when we are unable
to provide real catalog_desc, from catgets.c source:

  /* Be generous if catalog which failed to be open is used.  */
  if (catalog_desc == (nl_catd) -1 || ++set <= 0 || message < 0)
    return (char *) string;

12 years agoEnable PowerPC to be recognized by build.
Jon Trulson [Mon, 6 Aug 2012 23:09:01 +0000 (17:09 -0600)]
Enable PowerPC to be recognized by build.

Patch from Douglas Mencken.

12 years agoAdd Matthew Howkins (dtappbuilder, nsgmls, dtcm Linux compilation) 2.2.0a
Peter Howkins [Sat, 4 Aug 2012 22:16:08 +0000 (23:16 +0100)]
Add Matthew Howkins (dtappbuilder, nsgmls, dtcm Linux compilation)

Also note that other contributors are listed in copyright and copyright.old

12 years agoprograms/Imakefile: don't try to build dtksh or dtinfo under linux.
Jon Trulson [Sat, 4 Aug 2012 05:10:12 +0000 (23:10 -0600)]
programs/Imakefile: don't try to build dtksh or dtinfo under linux.