Received: by taz.hyperreal.com (8.6.12/8.6.5) id LAA07831; Tue, 23 Apr 1996 11:44:31 -0700 Received: from MIT.EDU by taz.hyperreal.com (8.6.12/8.6.5) with SMTP id LAA07820; Tue, 23 Apr 1996 11:44:27 -0700 From: mkgray@mit.edu Received: from BOKONON.MIT.EDU by MIT.EDU with SMTP id AA21269; Tue, 23 Apr 96 14:43:17 EDT Received: by bokonon.mit.edu (8.6.9/4.7) id OAA06951; Tue, 23 Apr 1996 14:44:08 -0400 Message-Id: <199604231844.OAA06951@bokonon.mit.edu> To: new-httpd@hyperreal.com Subject: Re: WWW Form Bug Report: "mod_status.c doesn't compile" on SunOS 4.x X-Url: http://www.mit.edu:8001/people/mkgray/mkgray.html Date: Tue, 23 Apr 1996 14:44:05 EDT Sender: owner-new-httpd@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com > thanks. A few people have pointed this out now. > > Hopefully it'll be added to a "known bugs" page on the Apache site. > >mod_status.c: In function `show_time': > >mod_status.c:119: invalid operands to binary + > >mod_status.c:121: invalid operands to binary + > >mod_status.c:123: invalid operands to binary + > >mod_status.c:125: invalid operands to binary + > >make: *** [mod_status.o] Error 1 We're using mod_status.c on www.mit.edu (SunOS) with the following patch. Since it has been pointed out that sprintf isn't guaranteed to give an int back (though it usually does) the #ifdef might not be appropriate and we may want to do this this way for all platforms. ...Mk *** mod_status.c.orig Tue Apr 23 14:40:58 1996 --- mod_status.c Tue Apr 23 14:41:22 1996 *************** *** 115,120 **** --- 115,142 ---- days=tsecs/24; s=buf; *s='\0'; + #ifdef SUNOS4 + if(days) + { + sprintf(s," %ld day%s",days,days==1?"":"s"); + s+=strlen(s); + } + if(hrs) + { + sprintf(s," %ld hour%s",hrs,hrs==1?"":"s"); + s+=strlen(s); + } + if(mins) + { + sprintf(s," %ld minute%s",mins,mins==1?"":"s"); + s+=strlen(s); + } + if(secs) + { + sprintf(s," %ld second%s",secs,secs==1?"":"s"); + s+=strlen(s); + } + #else if(days) s+=sprintf(s," %ld day%s",days,days==1?"":"s"); if(hrs) *************** *** 123,128 **** --- 145,151 ---- s+=sprintf(s," %ld minute%s",mins,mins==1?"":"s"); if(secs) s+=sprintf(s," %ld second%s",secs,secs==1?"":"s"); + #endif rputs(buf,r); }