You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by gr...@apache.org on 2003/01/14 16:02:00 UTC

cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

gregames    2003/01/14 07:02:00

  Modified:    specweb99/specweb99-2.0 mod_specweb99.c
  Log:
  capture the return value from apr_file_write_full to the post log so it will be
  logged on a failure.
  
  Reported by: Jason LaVoie <la...@NO_SPAM_us.ibm.com>
  
  Revision  Changes    Path
  1.17      +4 -3      httpd-test/specweb99/specweb99-2.0/mod_specweb99.c
  
  Index: mod_specweb99.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/specweb99/specweb99-2.0/mod_specweb99.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_specweb99.c	31 Oct 2002 19:39:04 -0000	1.16
  +++ mod_specweb99.c	14 Jan 2003 15:02:00 -0000	1.17
  @@ -765,8 +765,9 @@
   
   	line = apr_psprintf(r->pool, "%10d\n", 0);
   
  -	if (apr_file_write_full(f, line, strlen(line), NULL) != APR_SUCCESS) {
  -	    ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
  +        rv = apr_file_write_full(f, line, strlen(line), NULL);
  +        if (rv != APR_SUCCESS) {
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
   			 "Could not write to post.log '%s'", _my->log_path);
   	    returnHTMLPageWithMessage(r,
   				      "Error: could not write to post.log.");
  
  
  

Re: cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

Posted by "Roy T. Fielding" <fi...@apache.org>.
> Does anyone have a perl script etc. to automatically convert all 
> leading tabs to n blanks?  I was thinking of manually de-tabifying in 
> the vicinity of this fix, but it would be better to do the whole thing 
> if I can get my hands on such a tool.

Most Unices have a command called "expand" that does just that.

EXPAND(1)               System General Commands Manual               
EXPAND(1)

NAME
      expand, unexpand - expand tabs to spaces, and vice versa

SYNOPSIS
      expand [-tabstop] [-tab1,tab2,...,tabn] file ...
      unexpand [-a] file ...

DESCRIPTION
      expand processes the named files or the standard input writing the 
stan-
      dard output with tabs changed into blanks.  Backspace characters 
are pre-
      served into the output and decrement the column count for tab 
calcula-
      tions.  expand is useful for pre-processing character files 
(before sort-
      ing, looking at specific columns, etc.) that contain tabs.

      If a single tabstop argument is given, then tabs are set tabstop 
spaces
      apart instead of the default 8.  If multiple tabstops are given 
then the
      tabs are set at those specific columns.

      unexpand puts tabs back into the data from the standard input or 
the
      named files and writes the result on the standard output.

      Option (with unexpand only):

      -a    By default, only leading blanks and tabs are reconverted to 
maximal
            strings of tabs.  If the -a option is given, then tabs are 
inserted
            whenever they would compress the resultant file by replacing 
two or
            more characters.

HISTORY
      The expand command appeared in 3.0BSD.

4th Berkeley Distribution        June 9, 1993        4th Berkeley 
Distribution

....Roy


Re: cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

Posted by Greg Ames <gr...@apache.org>.
Sander Temme wrote:
>>Does anyone have a perl script etc. to automatically convert all leading tabs
>>to 
>>n blanks?  

> Doesn't indent do the trick, with the .indent.pro from somewhere in the
> httpd-2.0 tree? 

Roy T. Fielding wrote:

 > Most Unices have a command called "expand" that does just that.

De-tabbed and committed.  Thanks, Sander and Roy.

Greg





Re: cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

Posted by Sander Temme <sc...@covalent.net>.
> Does anyone have a perl script etc. to automatically convert all leading tabs
> to 
> n blanks?  I was thinking of manually de-tabifying in the vicinity of this
> fix, 
> but it would be better to do the whole thing if I can get my hands on such a
> tool.

Doesn't indent do the trick, with the .indent.pro from somewhere in the
httpd-2.0 tree? I can have my editor do the tabs -> spaces and commit.

S.

-- 
Covalent Technologies                             sctemme@covalent.net
Engineering group                                Voice: (415) 856 4214
303 Second Street #375 South                       Fax: (415) 856 4210
San Francisco CA 94107

   PGP Fingerprint: 7A8D B189 E871 80CB 9521  9320 C11E 7B47 964F 31D9

=======================================================
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
=======================================================


Re: cvs commit: httpd-test/specweb99/specweb99-2.0 mod_specweb99.c

Posted by Greg Ames <gr...@apache.org>.
gregames@apache.org wrote:

>   --- mod_specweb99.c	31 Oct 2002 19:39:04 -0000	1.16
>   +++ mod_specweb99.c	14 Jan 2003 15:02:00 -0000	1.17
>   @@ -765,8 +765,9 @@
>    
>    	line = apr_psprintf(r->pool, "%10d\n", 0);
>    
>   -	if (apr_file_write_full(f, line, strlen(line), NULL) != APR_SUCCESS) {
>   -	    ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
>   +        rv = apr_file_write_full(f, line, strlen(line), NULL);
>   +        if (rv != APR_SUCCESS) {
>   +            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
>    			 "Could not write to post.log '%s'", _my->log_path);

Does anyone have a perl script etc. to automatically convert all leading tabs to 
n blanks?  I was thinking of manually de-tabifying in the vicinity of this fix, 
but it would be better to do the whole thing if I can get my hands on such a tool.

Greg