🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
8 messages
8 total messages Started by Colin Perkins Wed, 14 Jul 1993 16:15
tin1.2PL1 patch for BSD-based systems
#4923
Author: Colin Perkins
Date: Wed, 14 Jul 1993 16:15
41 lines
1859 bytes
Hi,

There is a problem in tin1.2PL1 when building on BSD based systems,
due to the lack of a getcwd function on these machines. When doing a
"make bsd" the build fails at the link stage with an undefined symbol
_getcwd, and defining -DDONT_HAVE_GETCWD in the CCOPTS of the makefile
doesn't help.

This can be solved by changing the file misc.c as follows:

[This is part of the very last function in misc.c]

--------------------------------------------------------------------

jerez:~/programs/tin/tin-1.21-next > diff misc.c misc.c.orig
1659,1667c1659,1660
<
< /*    [Modified 14-7-1993 csp@ohm.york.ac.uk]
<  *
<  *    getcwd (currentdir, sizeof (currentdir));
<  */
<       get_cwd(currentdir);
< /*
<  *    [End of modification]
<  */
---
>
>       getcwd (currentdir, sizeof (currentdir));

--------------------------------------------------------------------

This seems to solve the problem and allows tin to build okay. 

Hope this helps,
Colin


-- 
Colin Perkins 				
Computer Systems Engineering Group,	Email: csp@ohm.york.ac.uk
University of York, YO1 5DD, UK.	Phone: +44 904 432379
Re: tin1.2PL1 patch for BSD-based systems
#4931
Author: Billy Barron
Date: Wed, 14 Jul 1993 22:39
13 lines
1274 bytes
csp@ohm.york.ac.uk (Colin Perkins) writes:

>There is a problem in tin1.2PL1 when building on BSD based systems,
>due to the lack of a getcwd function on these machines. When doing a
>"make bsd" the build fails at the link stage with an undefined symbol
>_getcwd, and defining -DDONT_HAVE_GETCWD in the CCOPTS of the makefile
>doesn't help.
>
FYI for others.  I'm on a Sun so I do a "make bsd" also and didn't have
this problem.  Colin, what kind of BSD system do you have?

Billy Barron
billy@utdallas.edu
Re: tin1.2PL1 patch for BSD-based systems
#4934
Author: Joe Rosenfeld
Date: Thu, 15 Jul 1993 00:04
15 lines
1281 bytes
Billy Barron (billy@sol.acs.unt.edu) wrote:
: csp@ohm.york.ac.uk (Colin Perkins) writes:

: FYI for others.  I'm on a Sun so I do a "make bsd" also and didn't have
: this problem.  Colin, what kind of BSD system do you have?

This happens to me, and I am running a NeXTStation Turbo with OS 3.0,
FYI.
--


| Joe Rosenfeld			   cowboy@trans.csuohio.edu
| CSU Law Library		    j.rosenfeld@csuohio.edu
| "If you always do what you always did, you will always get 
|               what you always got!" B.S.
Re: tin1.2PL1 patch for BSD-based systems
#4937
Author: Colin Perkins
Date: Thu, 15 Jul 1993 10:28
19 lines
1434 bytes
Joe Rosenfeld (cowboy@hobby.nl) wrote:
>Billy Barron (billy@sol.acs.unt.edu) wrote:
>: csp@ohm.york.ac.uk (Colin Perkins) writes:

>: FYI for others.  I'm on a Sun so I do a "make bsd" also and didn't have
>: this problem.  Colin, what kind of BSD system do you have?

>This happens to me, and I am running a NeXTStation Turbo with OS 3.0,
>FYI.
>--

This happens on both the NeXTs and our mips box if I do "make bsd".
With the patch they both work fine...

Colin
-- 
Colin Perkins 				
Computer Systems Engineering Group,	Email: csp@ohm.york.ac.uk
University of York, YO1 5DD, UK.	Phone: +44 904 432379
Re: tin1.2PL1 patch for BSD-based systems
#4938
Author: Joe Rosenfeld
Date: Thu, 15 Jul 1993 10:53
15 lines
1405 bytes
Joe Rosenfeld (cowboy@hobby.nl) wrote:
: Billy Barron (billy@sol.acs.unt.edu) wrote:
: : csp@ohm.york.ac.uk (Colin Perkins) writes:

: : FYI for others.  I'm on a Sun so I do a "make bsd" also and didn't have
: : this problem.  Colin, what kind of BSD system do you have?

: This happens to me, and I am running a NeXTStation Turbo with OS 3.0,
: FYI.

Actually, as a follow-up, I had to remove the getcwd line in misc.c.  I
wonder why the define does NOT function, and what the side-affects will
be from removing the line.

Joe
Re: tin1.2PL1 patch for BSD-based systems
#4939
Author: Leila Burrell-Davis
Date: Thu, 15 Jul 1993 11:10
36 lines
1793 bytes
Colin Perkins (csp@ohm.york.ac.uk) wrote:

: There is a problem in tin1.2PL1 when building on BSD based systems,
: due to the lack of a getcwd function on these machines. When doing a
: "make bsd" the build fails at the link stage with an undefined symbol
: _getcwd, and defining -DDONT_HAVE_GETCWD in the CCOPTS of the makefile
: doesn't help.

: This can be solved by changing the file misc.c as follows:

[ patch deleted ] 

A slightly more general patch is:

*** misc.c.dist	Wed Jul 14 15:28:30 1993
--- misc.c	Wed Jul 14 15:30:45 1993
***************
*** 1657,1663 ****
--- 1657,1667 ----
  	char *ptr, buf[LEN];
  	char currentdir[PATH_LEN];
  	
+ #ifdef DONT_HAVE_GETCWD
+         getwd (currentdir);
+ #else
  	getcwd (currentdir, sizeof (currentdir));
+ #endif
  	chdir (dir);
  	sprintf (buf, cmd, file);
  #ifdef M_OS2
-----
Leila
-- 
Leila Burrell-Davis, Computing Service, University of Sussex, Brighton, UK
Tel:   +44 273 678390              Fax:   +44 273 678470
Email: leilabd@syma.sussex.ac.uk  (JANET: leilabd@uk.ac.sussex.syma)
Re: tin1.2PL1 patch for BSD-based systems
#4952
Author: Colin Perkins
Date: Thu, 15 Jul 1993 20:43
19 lines
1471 bytes
Leila Burrell-Davis (leilabd@syma.sussex.ac.uk) wrote:
>Colin Perkins (csp@ohm.york.ac.uk) wrote:
>[ patch deleted ] 
>A slightly more general patch is:

[slightly more general (?) patch deleted]

Except that changing the getcwd to get_cwd as I did calls Iain's
routine which has the #ifdefs built in. This has the advantage of
localising the machine dependant code into a single function, instead
of spreading it around the program... That said, the two patchs have
the same effect, so who cares? (Except perhaps Iain who has to
maintain it...)

Colin
-- 
Colin Perkins 				
Computer Systems Engineering Group,	Email: csp@ohm.york.ac.uk
University of York, YO1 5DD, UK.	Phone: +44 904 432379
Re: tin1.2PL1 patch for BSD-based systems
#4976
Author: Greg Earle
Date: Sun, 18 Jul 1993 00:20
40 lines
2681 bytes
In article <1993Jul15.204306.1377@ohm.york.ac.uk> csp@ohm.york.ac.uk (Colin Perkins) writes:
>Leila Burrell-Davis (leilabd@syma.sussex.ac.uk) wrote:
>>Colin Perkins (csp@ohm.york.ac.uk) wrote:
>>[ patch deleted ] 
>>A slightly more general patch is:
>
>[slightly more general (?) patch deleted]
>
>Except that changing the getcwd to get_cwd as I did calls Iain's
>routine which has the #ifdefs built in. This has the advantage of
>localising the machine dependant code into a single function, instead
>of spreading it around the program ... That said, the two patches have
>the same effect, so who cares? (Except perhaps Iain who has to
>maintain it...)

I don't use TIN so I can't comment on the "get_cwd()" function use, but to
answer the person who said they didn't have this problem on SunOS, that is
for a very simple reason - getcwd(3v) is provided as a System V compatibility
function.  However, it is provided for compatbility only, and it should not
be used (compiled in) under SunOS.  The getwd(3) function is preferred.  See
the BUGS section of getcwd(3v):

..
BUGS
     Since this function uses popen() to create a pipe to the pwd
     command,  it  is  slower than getwd() and gives poorer error
     diagnostics.  getcwd() is provided  only  for  compatibility
     with other UNIX operating systems.

If "get_cwd()" is some general function that uses "getwd()" if this
DONT_HAVE_GETCWD #define exists, and it is used a lot in the code, then I
would say Colin's patch is preferrable.  If not (i.e., an actual use of
"getcwd()" is not done very often), then inlining the "getwd()" #ifdef would
be better.

-- 
	- Greg Earle
	  Phone: (818) 353-8695		FAX: (818) 353-1877
	  Internet: earle@isolar.Tujunga.CA.US
	  UUCP: isolar!earle@elroy.JPL.NASA.GOV a.k.a. ...!elroy!isolar!earle
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads