cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c

1999-11-13 Thread jim
jim 99/11/13 06:39:54

  Modified:src/lib/apr acconfig.h configure.in
   src/lib/apr/file_io/unix dir.c
  Log:
  Handle the fact that FreeBSD has threaded functions in
  libc_r and not libpthread
  
  Revision  ChangesPath
  1.12  +2 -0  apache-2.0/src/lib/apr/acconfig.h
  
  Index: acconfig.h
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/acconfig.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- acconfig.h1999/11/10 13:40:52 1.11
  +++ acconfig.h1999/11/13 14:39:51 1.12
  @@ -39,6 +39,8 @@
   #undef USE_PROC_PTHREAD_SERIALIZE
   #undef USE_PTHREAD_SERIALIZE
   
  +#undef READDIR_IS_THREAD_SAFE
  +
   #undef NEED_RLIM_T
   #undef USEBCOPY
   
  
  
  
  1.26  +5 -0  apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- configure.in  1999/11/13 00:07:05 1.25
  +++ configure.in  1999/11/13 14:39:52 1.26
  @@ -86,7 +86,11 @@
   AC_DEFINE_UNQUOTED($ac_decision) 
   
   AC_CHECK_LIB(pthread, pthread_mutex_init, AC_DEFINE(USE_PTHREAD_SERIALIZE))
  +AC_CHECK_LIB(c_r, pthread_mutex_init, AC_DEFINE(USE_PTHREAD_SERIALIZE))
  +ac_cv_define_READDIR_IS_THREAD_SAFE=no
  +AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE))
   
  +
   case $OS in
  *-os2*)
  CFLAGS=$CFLAGS -DOS2 -Zmt
  @@ -104,6 +108,7 @@
   
   AC_CHECK_LIB(dl, dlopen)
   AC_CHECK_LIB(pthread, pthread_mutex_init)
  +AC_CHECK_LIB(c_r, pthread_mutex_init)
   AC_CHECK_LIB(socket,socket)
   AC_CHECK_LIB(crypt,crypt)
   AC_CHECK_LIB(ufc,crypt)
  
  
  
  1.16  +2 -1  apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- dir.c 1999/11/04 07:26:20 1.15
  +++ dir.c 1999/11/13 14:39:53 1.16
  @@ -124,7 +124,8 @@
*/
   ap_status_t ap_readdir(struct dir_t *thedir)
   {
  -#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS)
  +#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
  + !defined(READDIR_IS_THREAD_SAFE)
   ap_status_t ret;
   ret = readdir_r(thedir-dirstruct, thedir-entry, thedir-entry);
   /* Avoid the Linux problem where at end-of-directory thedir-entry
  
  
  


cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c

1999-10-31 Thread rse
rse 99/10/31 08:18:36

  Modified:src/lib/apr/time/unix time.c
   src/lib/apr/file_io/unix dir.c
  Log:
  Be careful, _POSIX_THREAD_SAFE_FUNCTIONS is a feature test macro, yes, but it
  works by being either defined or not. It's not always defined and just has a
  value 0 or not 0...
  
  Revision  ChangesPath
  1.11  +2 -2  apache-2.0/src/lib/apr/time/unix/time.c
  
  Index: time.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/time/unix/time.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- time.c1999/10/19 19:21:22 1.10
  +++ time.c1999/10/31 16:18:35 1.11
  @@ -107,7 +107,7 @@
   {
   switch (type) {
   case APR_LOCALTIME: {
  -#if APR_HAS_THREADS  _POSIX_THREAD_SAFE_FUNCTIONS
  +#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS)
   localtime_r(atime-currtime-tv_sec, atime-explodedtime);
   #else
   atime-explodedtime = localtime(atime-currtime-tv_sec);
  @@ -115,7 +115,7 @@
   break;
   }
   case APR_UTCTIME: {
  -#if APR_HAS_THREADS  _POSIX_THREAD_SAFE_FUNCTIONS
  +#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS)
   gmtime_r(atime-currtime-tv_sec, atime-explodedtime);
   #else
   atime-explodedtime = gmtime(atime-currtime-tv_sec);
  
  
  
  1.14  +1 -1  apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- dir.c 1999/10/23 21:23:20 1.13
  +++ dir.c 1999/10/31 16:18:36 1.14
  @@ -124,7 +124,7 @@
*/
   ap_status_t ap_readdir(struct dir_t *thedir)
   {
  -#if APR_HAS_THREADS  _POSIX_THREAD_SAFE_FUNCTIONS
  +#if APR_HAS_THREADS  defined(_POSIX_THREAD_SAFE_FUNCTIONS)
   ap_status_t ret;
   ret = readdir_r(thedir-dirstruct, thedir-entry, thedir-entry);
   /* Avoid the Linux problem where at end-of-directory thedir-entry
  
  
  


cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c

1999-10-23 Thread martin
martin  99/10/23 14:23:20

  Modified:src/lib/apr/file_io/unix dir.c
  Log:
  The readdir_r() function in Linux does return with a zero return
  even when end-of-file was reached and dir-entry was set to NULL.
  Handle this situation graefully and fake an EOF condition.
  (This modification was required to get mod_speling running).
  
  Revision  ChangesPath
  1.13  +12 -2 apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /export/home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- dir.c 1999/10/23 20:15:16 1.12
  +++ dir.c 1999/10/23 21:23:20 1.13
  @@ -124,8 +124,13 @@
*/
   ap_status_t ap_readdir(struct dir_t *thedir)
   {
  -#if APR_HAS_THREADS  _POSIX_THREAD_SAFE_FUNCTIONS 
  -return readdir_r(thedir-dirstruct, thedir-entry, thedir-entry);
  +#if APR_HAS_THREADS  _POSIX_THREAD_SAFE_FUNCTIONS
  +ap_status_t ret;
  +ret = readdir_r(thedir-dirstruct, thedir-entry, thedir-entry);
  +/* Avoid the Linux problem where at end-of-directory thedir-entry
  + * is set to NULL, but ret = APR_SUCCESS.
  + */
  +return (ret == APR_SUCCESS  thedir-entry == NULL) ? APR_ENOENT : ret;
   #else
   
   thedir-entry = readdir(thedir-dirstruct);
  @@ -288,6 +293,11 @@
*/
   ap_status_t ap_get_dir_filename(char **new, struct dir_t *thedir)
   {
  +/* Detect End-Of-File */
  +if (thedir == NULL || thedir-entry == NULL) {
  +   *new = NULL;
  +   return APR_ENOENT;
  +}
   (*new) = ap_pstrdup(thedir-cntxt, thedir-entry-d_name);
   return APR_SUCCESS;
   }
  
  
  


cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c fileacc.c

1999-10-04 Thread rbb
rbb 99/10/04 06:37:20

  Modified:src/lib/apr/file_io/unix dir.c fileacc.c
  Log:
  Ifdef out the code that checks to make sure the file descriptor isn't a
  socket.  BeOS files cannot be sockets, so this code isn't needed and won't
  compile.
  Submitted by:  David Reid
  
  Revision  ChangesPath
  1.4   +2 -0  apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- dir.c 1999/10/01 16:18:28 1.3
  +++ dir.c 1999/10/04 13:37:19 1.4
  @@ -264,8 +264,10 @@
   *type = APR_PIPE;
   if (S_ISLNK(filestat.st_mode))
   *type = APR_LNK;
  +#ifndef BEOS
   if (S_ISSOCK(filestat.st_mode))
   *type = APR_SOCK;
  +#endif
   return APR_SUCCESS;
   }
   
  
  
  
  1.6   +2 -0  apache-2.0/src/lib/apr/file_io/unix/fileacc.c
  
  Index: fileacc.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/fileacc.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- fileacc.c 1999/10/01 16:18:28 1.5
  +++ fileacc.c 1999/10/04 13:37:19 1.6
  @@ -238,8 +238,10 @@
   *type = APR_PIPE;
   if (S_ISLNK(file-protection))
   *type = APR_LNK;
  +#ifndef BEOS
   if (S_ISSOCK(file-protection))
   *type = APR_SOCK;
  +#endif
   return APR_SUCCESS;
   }
   else {
  
  
  


cvs commit: apache-2.0/src/lib/apr/file_io/unix dir.c open.c

1999-09-03 Thread rbb
rbb 99/09/03 05:22:28

  Modified:src/lib/apr/file_io/unix dir.c open.c
  Log:
  Fix some APR documentation.
  Submitted by:  Paul Reder
  
  Revision  ChangesPath
  1.2   +3 -3  apache-2.0/src/lib/apr/file_io/unix/dir.c
  
  Index: dir.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/dir.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dir.c 1999/08/17 15:59:36 1.1
  +++ dir.c 1999/09/03 12:22:27 1.2
  @@ -132,7 +132,7 @@
   }
   
   /* ***APRDOC
  - * ap_status_t ap_readdir(ap_dir_t *)
  + * ap_status_t ap_rewinddir(ap_dir_t *)
*Rewind the directory to the first entry. 
* arg 1) the directory descriptor to rewind.
*/
  @@ -270,7 +270,7 @@
   }
   
   /* ***APRDOC
  - * ap_status_t ap_dir_entry_filename(ap_dir_t *, char **) 
  + * ap_status_t ap_get_dir_filename(ap_dir_t *, char **) 
*Get the file name of the current directory entry. 
* arg 1) the currently open directory.
* arg 2) the file name of the directory entry. 
  @@ -297,7 +297,7 @@
   }
   
   /* ***APRDOC
  - * ap_status_t ap_get_os_dir(ap_dir_t *, ap_os_dir_t *)
  + * ap_status_t ap_put_os_dir(ap_dir_t *, ap_os_dir_t *)
*convert the dir from os specific type to apr type.
* arg 1) The os specific dir to convert
* arg 2) The apr dir we are converting to.
  
  
  
  1.4   +1 -1  apache-2.0/src/lib/apr/file_io/unix/open.c
  
  Index: open.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/open.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- open.c1999/09/01 19:01:52 1.3
  +++ open.c1999/09/03 12:22:27 1.4
  @@ -95,7 +95,7 @@
*  APR_CREATE   create the file if not there
*  APR_APPEND   file ptr is set to end prior to all writes
*  APR_TRUNCATE set length to zero if file exists
  - *  APR_BINARY   not a text file
  + *  APR_BINARY   not a text file (This flag is ignored on 
UNIX because it has no meaning)
*  APR_BUFFERED buffer the data.  Default is non-buffered
*  APR_EXCL return error if APR_CREATE and file exists
* arg 4) Access permissions for file.