cvs commit: apache-apr/apr/test testfile.c testproc.c

1999-06-08 Thread rbb
rbb 99/06/08 08:52:16

  Modified:apr/test testfile.c testproc.c
  Log:
  Indentation change, trying to keep things looking like the style guide.  :)
  
  Revision  ChangesPath
  1.28  +1 -1  apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- testfile.c1999/06/07 13:21:44 1.27
  +++ testfile.c1999/06/08 15:52:14 1.28
  @@ -64,7 +64,7 @@
   int test_filedel(ap_context_t *);
   int testdirs(ap_context_t *);
   
  -void main()
  +int main()
   {
   ap_context_t *context;
   ap_file_t *thefile = NULL;
  
  
  
  1.11  +1 -1  apache-apr/apr/test/testproc.c
  
  Index: testproc.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testproc.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- testproc.c1999/06/08 15:35:25 1.10
  +++ testproc.c1999/06/08 15:52:14 1.11
  @@ -84,7 +84,7 @@
   teststr = ap_pstrdup(context, Whooo H\0);
   
   if (argc  1) {
  - fprintf(stdout, %s, teststr);
  + fprintf(stdout, %s, teststr);
   exit(1);
   }
   fprintf(stdout, Creating procattr...);
  
  
  


Re: cvs commit: apache-apr/apr/test testfile.c

1999-06-07 Thread Ryan Bloom
On 6 Jun 1999 [EMAIL PROTECTED] wrote:

   - The directory entry for a file doesn't have it's size attribute updated 
 until
 the file is closed or flushed.

I don't like this.  I would rather have the file flushed each time data is
written to it, than have to close the file to update the directory update.
I saw this same problem on Windows, and I just decided to flush the
buffer.  IMHO, the OS is broken if it is buffering output to a file, but
not using that buffer at ALL time the file is referenced.

Do you have any strong objections to putting the test back the way it was,
and flushing the file with each write.  I know it will cause a performance
hit, but it will make the results more predicatable.

Ryan


___
Ryan Bloom  [EMAIL PROTECTED]
4205 S Miami Blvd   
RTP, NC 27709   It's a beautiful sight to see good dancers 
doing simple steps.  It's a painful sight to
see beginners doing complicated patterns.   



cvs commit: apache-apr/apr/test testfile.c

1999-06-07 Thread rbb
rbb 99/06/07 06:21:44

  Modified:apr/file_io/win32 open.c
   apr/include apr_lib.h
   apr/test testfile.c
  Log:
  Final commit to get file stuff working reliably on Windows.
  
  Revision  ChangesPath
  1.2   +1 -1  apache-apr/apr/file_io/win32/open.c
  
  Index: open.c
  ===
  RCS file: /home/cvs/apache-apr/apr/file_io/win32/open.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- open.c1999/06/03 19:43:45 1.1
  +++ open.c1999/06/07 13:21:41 1.2
  @@ -159,7 +159,7 @@
   {
   char *temp = canonical_filename(cont, path);
   
  -if (DeleteFile(temp) == 0) {
  +if (DeleteFile(temp)) {
return APR_SUCCESS;
   }
   else {
  
  
  
  1.9   +2 -0  apache-apr/apr/include/apr_lib.h
  
  Index: apr_lib.h
  ===
  RCS file: /home/cvs/apache-apr/apr/include/apr_lib.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- apr_lib.h 1999/06/02 18:44:35 1.8
  +++ apr_lib.h 1999/06/07 13:21:43 1.9
  @@ -67,6 +67,8 @@
   #include apr_general.h
   #ifndef WIN32
   #include apr_config.h
  +#else
  +#include apr_win.h
   #endif
   #include hsregex.h
   
  
  
  
  1.27  +1 -2  apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- testfile.c1999/06/06 09:17:50 1.26
  +++ testfile.c1999/06/07 13:21:44 1.27
  @@ -52,12 +52,11 @@
* project, please see http://www.apache.org/.
*
*/
  +#include stdio.h
   #include apr_file_io.h
   #include apr_errno.h
   #include apr_general.h
   #include apr_lib.h
  -#include errno.h
  -#include stdio.h
   #ifdef BEOS
   #include unistd.h
   #endif
  
  
  


cvs commit: apache-apr/apr/test testfile.c

1999-06-06 Thread bjh
bjh 99/06/06 02:17:52

  Modified:apr/test testfile.c
  Log:
  Modify testfile.c to take into account that in OS/2 and possibly other 
platforms:
  - An open file can't be deleted.
  - The directory entry for a file doesn't have it's size attribute updated 
until
the file is closed or flushed.
  
  I've also added an extra error check.
  
  Revision  ChangesPath
  1.26  +8 -5  apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- testfile.c1999/06/03 19:43:55 1.25
  +++ testfile.c1999/06/06 09:17:50 1.26
  @@ -55,6 +55,7 @@
   #include apr_file_io.h
   #include apr_errno.h
   #include apr_general.h
  +#include apr_lib.h
   #include errno.h
   #include stdio.h
   #ifdef BEOS
  @@ -193,11 +194,11 @@
return stat;
   }
   
  -if ((stat = ap_remove_file(context, testdel))  != APR_SUCCESS) {
  +if ((stat = ap_close(thefile))  != APR_SUCCESS) {
   return stat;
   }
   
  -if ((stat = ap_close(thefile))  != APR_SUCCESS) {
  +if ((stat = ap_remove_file(context, testdel))  != APR_SUCCESS) {
   return stat;
   }
   
  @@ -234,6 +235,7 @@
   
   bytes = strlen(Another test!!!);
   ap_write(file, Another test!!, bytes); 
  + ap_close(file);
   
   fprintf(stdout, \tOpening Directory...);
   if (ap_opendir(context, testdir, temp) != APR_SUCCESS) {
  @@ -259,7 +261,10 @@
   /* Because I want the file I created, I am skipping the . and ..
* files that are here. 
*/
  -ap_readdir(temp); 
  +if (ap_readdir(temp) != APR_SUCCESS) {
  +fprintf(stderr, Error reading directory testdir); 
  +return -1;
  +}
   ap_get_dir_filename(temp, fname);
   } while (fname[0] == '.');
   if (strcmp(fname, testfile)) {
  @@ -296,8 +301,6 @@
   else {
   fprintf(stdout, OK\n);
   }
  -
  - ap_close(file);
   
   fprintf(stdout, \tRemoving file from directory...);
   if (ap_remove_file(context, testdir/testfile)  != APR_SUCCESS) {
  
  
  


cvs commit: apache-apr/apr/test testfile.c

1999-04-09 Thread rbb
rbb 99/04/09 08:05:17

  Modified:apr/file_io/unix open.c
   apr/test testfile.c
  Log:
  I got rid of the memory leak related to opening and closing files.
  
  Revision  ChangesPath
  1.11  +5 -0  apache-apr/apr/file_io/unix/open.c
  
  Index: open.c
  ===
  RCS file: /home/cvs/apache-apr/apr/file_io/unix/open.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- open.c1999/04/08 17:09:30 1.10
  +++ open.c1999/04/09 15:05:15 1.11
  @@ -91,6 +91,7 @@
   }
   if ((flag  APR_EXCL)  !(flag  APR_CREATE)) {
   errno = EACCES;
  +free(dafile-fname);
free(dafile);
   return NULL;
   }   
  @@ -112,6 +113,7 @@
   
   if (dafile-filedes  0) {
   dafile-filedes = -1;
  +free(dafile-fname);
   free(dafile);
   return NULL;
   }
  @@ -121,6 +123,7 @@
   }
   else {
   errno = ENOSTAT;
  +free(dafile-fname);
free(dafile);
   return NULL;
   }
  @@ -130,6 +133,8 @@
   {
   if (close(file-filedes) == 0) {
   file-filedes = -1;
  +free(file-fname);
  +free(file);
   return APR_SUCCESS;
   }
   else {
  
  
  
  1.8   +1 -1  apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- testfile.c1999/04/09 14:36:59 1.7
  +++ testfile.c1999/04/09 15:05:16 1.8
  @@ -152,7 +152,7 @@
   }
   
   fprintf(stdout, \tDeleting file...);
  -status = apr_remove_file(thefile-fname);
  +status = apr_remove_file(filename);
   if (status == APR_FAILURE) {
   fprintf(stderr, Couldn't delete the file\n);
   exit(-1); 
  
  
  


cvs commit: apache-apr/apr/test testfile.c

1999-02-25 Thread rbb
rbb 99/02/25 09:34:33

  Modified:apr/test testfile.c
  Log:
  Forgot to add the Copyright comment when I checked this in the first time,
  so I'm adding it now.
  
  Revision  ChangesPath
  1.2   +55 -0 apache-apr/apr/test/testfile.c
  
  Index: testfile.c
  ===
  RCS file: /home/cvs/apache-apr/apr/test/testfile.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testfile.c1999/02/25 16:42:38 1.1
  +++ testfile.c1999/02/25 17:34:33 1.2
  @@ -1,3 +1,58 @@
  +/* 
  + * Copyright (c) 1999 The Apache Group.  All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *notice, this list of conditions and the following disclaimer. 
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *notice, this list of conditions and the following disclaimer in
  + *the documentation and/or other materials provided with the
  + *distribution.
  + *
  + * 3. All advertising materials mentioning features or use of this
  + *software must display the following acknowledgment:
  + *This product includes software developed by the Apache Group
  + *for use in the Apache HTTP server project (http://www.apache.org/).
  + *
  + * 4. The names Apache Server and Apache Group must not be used to
  + *endorse or promote products derived from this software without
  + *prior written permission. For written permission, please contact
  + *[EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called Apache
  + *nor may Apache appear in their names without prior written
  + *permission of the Apache Group.
  + *
  + * 6. Redistributions of any form whatsoever must retain the following
  + *acknowledgment:
  + *This product includes software developed by the Apache Group
  + *for use in the Apache HTTP server project (http://www.apache.org/).
  + *
  + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  + * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  + * OF THE POSSIBILITY OF SUCH DAMAGE.
  + * 
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Group.
  + * For more information on the Apache Group and the Apache HTTP server
  + * project, please see http://www.apache.org/.
  + *
  + */
  +
   #include apr_file_io.h
   #include apr_errno.h
   #include apr_general.h