🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #1766

Interesting bug in compress on 88000 Systems

#1766
From: Chris Lewis
Date: Fri, 19 Apr 1991 03:43
29 lines
1745 bytes
[Pardon the cross-post, but this seemed to be of interest to both the OS
people and the language people]

When compress tries to set the time on the file it's just
created to be the same as the original file, things go a little
awry.  The code is:

	time_t timep[2];
	...
	timep[0] = statbuf.st_atime;
	timep[1] = statbuf.st_mtime;
	utime(ofname, timep);	/* Update last accessed and modified times */

On the 88000, (as in 1003.1), timep is actually a struct.  All would be well,
except on the 88000 they've inserted an additional time_t after the atime
and the mtime field to contain microseconds....  So, what happens is that
the atime is set properly, the atime usec field is set to mtime, and the mtime is
set to garbage (the epoch due to the stack contents in my case).  I'm not sure
whether this makes the OS/header file noncompliant with 1003.1.

Looks to me that compress.c needs an ifdef so as to use the struct
definition.

(Motorola Delta 88000 system with Greenhills C compiler)
-- 
Chris Lewis, Phone: (613) 832-0541, Internet: clewis@ferret.ocunix.on.ca
UUCP: uunet!mitel!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!
Technical Details
Message-ID: <1416@ecicrl.ocunix.on.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!mauxci!eci386!ecicrl!clewis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!mauxci!eci386!ecicrl!clewis
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Newsgroups: comp.sources.d,comp.unix.programmer,comp.lang.c,comp.unix.wizards
Subject: Interesting bug in compress on 88000 Systems
Message-ID: <1416@ecicrl.ocunix.on.ca>
Date: 19 Apr 91 03:43:39 GMT
Followup-To: comp.sources.d
Organization: Elegant Communications Inc., Ottawa, Canada
Lines: 29