Bug 344 - syntax error in bsd-misc.c / utimes()
Summary: syntax error in bsd-misc.c / utimes()
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: ix86 Other
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-09 05:29 AEST by Gert Doering
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gert Doering 2002-07-09 05:29:49 AEST
bsd-misc.c needs the following patch to compile on SCO 3.2v4.2 (which
has no utimes()).  I did not test this, just tried to adapt the code to what
the utimes() man pages on FreeBSD says it should do.  Someone needs
more coffee here :-)

-------- snip --------
--- bsd-misc.c  3 Jul 2002 23:50:00 -0000       1.9
+++ bsd-misc.c  8 Jul 2002 19:30:26 -0000
@@ -93,8 +93,8 @@
 {
        struct utimbuf ub;
 
-       ub.actime = tvp[0]->tv_sec;
-       ub.modtime = tvp[1]->tv_usec;
+       ub.actime = tvp[0].tv_sec;
+       ub.modtime = tvp[1].tv_sec;
 
        return(utime(filename, &ub));
 }
Comment 1 Ben Lindstrom 2002-07-09 05:35:23 AEST
Tim and I are talking about this.  I need to fix my version that I commited of 
this to current.  This breaks UnixWare since UnixWare does not seem to handle
it right for some odd reason.

- Ben 
Comment 2 Gert Doering 2002-07-09 06:51:13 AEST
Well, what's in there is syntacticatlly incorrect (gcc barfs about the "->",
as tvp[0]-> will do a double dereference on a single pointer), and it's also
semantically incorrect as the second value should not be tv_*u*sec.

What is breaking on UnixWare?
Comment 3 Tim Rice 2002-07-09 07:13:09 AEST
UnixWare is happy with Gert's patch. 
Comment 4 Ben Lindstrom 2002-07-09 07:40:51 AEST
Already commited.

I'd like to know what NeXT did not mind it.  I'll have to test it when I get 
home.
Comment 5 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED