cvs commit: apache-2.0/src/os/beos beosd.c

1999-12-15 Thread dreid
dreid   99/12/15 03:54:36

  Modified:src/os/beos beosd.c
  Log:
  A small change to allow Apache to run on the most recent versions
  of BeOS.
  
  Revision  ChangesPath
  1.8   +3 -0  apache-2.0/src/os/beos/beosd.c
  
  Index: beosd.c
  ===
  RCS file: /home/cvs/apache-2.0/src/os/beos/beosd.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- beosd.c   1999/11/24 16:46:03 1.7
  +++ beosd.c   1999/12/15 11:54:35 1.8
  @@ -109,6 +109,8 @@
   
   static int set_group_privs(void)
   {
  +#if B_BEOS_VERSION  0x0460
  +
   if (!geteuid()) {
char *name;
   
  @@ -147,6 +149,7 @@
return -1;
}
   }
  +#endif
   return 0;
   }
   
  
  
  


cvs commit: apache-2.0/src/os/beos beosd.c

1999-11-24 Thread dreid
dreid   99/11/24 08:46:06

  Modified:src/os/beos beosd.c
  Log:
  Clean up some code that BeOS doesn't use.
  
  Revision  ChangesPath
  1.7   +0 -16 apache-2.0/src/os/beos/beosd.c
  
  Index: beosd.c
  ===
  RCS file: /home/cvs/apache-2.0/src/os/beos/beosd.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- beosd.c   1999/11/19 18:49:09 1.6
  +++ beosd.c   1999/11/24 16:46:03 1.7
  @@ -65,26 +65,10 @@
   
   void beosd_detach(void)
   {
  -/*int x;  This isn't needed due to the fork() issue */
   pid_t pgrp;
   
   chdir(/);
   
  -/* 
  - * fork() is evil if we're also doing spawn_thread...so we don't use it.
  - * This means that it won't detach properly, so we'll have to find a way
  - * round this. 
  - */
  -/*
  -if ((x = fork())  0)
  - exit(0);
  -else if (x == -1) {
  - perror(fork);
  - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  - %s: unable to fork new process, ap_server_argv0);
  - exit(1);
  -}
  -*/
   RAISE_SIGSTOP(DETACH);
   
   if ((pgrp = setsid()) == -1) {
  
  
  


cvs commit: apache-2.0/src/os/beos beosd.c

1999-11-16 Thread rbb
rbb 99/11/16 10:32:09

  Modified:.STATUS
   src/lib/apr/include apr_lib.h
   src/main http_config.c http_connection.c http_core.c
http_protocol.c http_request.c http_vhost.c util.c
util_md5.c util_script.c
   src/modules/mpm/dexter dexter.c
   src/modules/mpm/mpmt_beos mpmt_beos.c
   src/modules/mpm/mpmt_pthread mpmt_pthread.c scoreboard.c
   src/modules/mpm/prefork prefork.c
   src/modules/mpm/spmt_os2 spmt_os2.c
   src/modules/mpm/winnt winnt.c
   src/os/beos beosd.c
  Log:
  Cleanup the ZZZ comments.  Basically these used to mark places where APR
  is needed.  It is much easier to do this conversion by hand than by
  searching for old comments, so they are going away now.
  
  Revision  ChangesPath
  1.15  +1 -3  apache-2.0/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/apache-2.0/STATUS,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- STATUS1999/11/16 15:11:51 1.14
  +++ STATUS1999/11/16 18:30:18 1.15
  @@ -1,5 +1,5 @@
   Apache 2.0 STATUS:
  -Last modified at [$Date: 1999/11/16 15:11:51 $]
  +Last modified at [$Date: 1999/11/16 18:30:18 $]
   
   Release:
   
  @@ -117,8 +117,6 @@
   Status: ?
   
   * TODO in source -- just do an egrep on TODO and see what's there
  -
  -* Odd comments in source (egrep for ZZZ) need to be cleaned-up
   
   * Work on other MPMs. Possible MPMs discussed or in progress include:
   
  
  
  
  1.14  +0 -7  apache-2.0/src/lib/apr/include/apr_lib.h
  
  Index: apr_lib.h
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_lib.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- apr_lib.h 1999/10/13 18:07:22 1.13
  +++ apr_lib.h 1999/11/16 18:30:26 1.14
  @@ -382,13 +382,6 @@
void *data, enum kill_conditions kill_how,
FILE **pipe_in, FILE **pipe_out,
FILE **pipe_err);
  -#if 0
  -API_EXPORT(int)
  - ap_bspawn_child(ap_context_t *p,
  -  int (*func) (void *v, ap_child_info_t *c),
  -  void *data, enum kill_conditions kill_how,
  -  BUFF **pipe_in, BUFF **pipe_out, BUFF **pipe_err);
  -#endif /* 0 */
   
   API_EXPORT(char *) ap_cpystrn(char *dst, const char *src, size_t dst_size);
   
  
  
  
  1.18  +3 -5  apache-2.0/src/main/http_config.c
  
  Index: http_config.c
  ===
  RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- http_config.c 1999/11/08 06:05:48 1.17
  +++ http_config.c 1999/11/16 18:30:32 1.18
  @@ -1021,14 +1021,14 @@
   
   if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) ||
!(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE {
  - if (stat(fname, finfo) == -1)   /* ZZZ  can we read the file?  ACCESS 
better here. */
  + if (stat(fname, finfo) == -1)   
return;
   }
   
   /* don't require conf/httpd.conf if we have a -C or -c switch */
   if((ap_server_pre_read_config-nelts || 
ap_server_post_read_config-nelts) 
  !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE {
  - if (stat(fname, finfo) == -1) /* ZZZ  can we read the file?  
ACCESS better here. */ 
  + if (stat(fname, finfo) == -1) 
return;
   }
   
  @@ -1041,7 +1041,6 @@
   parms.override = (RSRC_CONF | OR_ALL)  ~(OR_AUTHCFG | OR_LIMIT);
   
   if (ap_pcfg_openfile(parms.config_file, p, fname) != APR_SUCCESS) {
  -/* ZZZ  use ap_strerror() once it exists to print an error message */
fprintf(stderr, %s: could not open document config file %s\n,
ap_server_argv0, fname);
exit(1);
  @@ -1262,14 +1261,13 @@
   s-limit_req_line = DEFAULT_LIMIT_REQUEST_LINE;
   s-limit_req_fieldsize = DEFAULT_LIMIT_REQUEST_FIELDSIZE;
   s-limit_req_fields = DEFAULT_LIMIT_REQUEST_FIELDS;
  -s-timeout = DEFAULT_TIMEOUT; /*ZZZ use AP default timeouts here*/
  +s-timeout = DEFAULT_TIMEOUT; 
   s-keep_alive_timeout = DEFAULT_KEEPALIVE_TIMEOUT;
   s-keep_alive_max = DEFAULT_KEEPALIVE;
   s-keep_alive = 1;
   s-next = NULL;
   s-addrs = ap_pcalloc(p, sizeof(server_addr_rec));
   /* NOT virtual host; don't match any real network interface */
  -/* ZZZ  Initialize the Network Address here. */
   s-addrs-host_addr.s_addr = htonl(INADDR_ANY);
   s-addrs-host_port = 0; /* matches any port */
   s-addrs-virthost = ; /* must be 

cvs commit: apache-2.0/src/os/beos beosd.c iol_socket.c

1999-10-22 Thread dreid
dreid   99/10/22 04:25:42

  Modified:src/os/beos beosd.c iol_socket.c
  Log:
  This brings BeOS back up to date with the recent changes.
  
  Revision  ChangesPath
  1.4   +4 -4  apache-2.0/src/os/beos/beosd.c
  
  Index: beosd.c
  ===
  RCS file: /home/cvs/apache-2.0/src/os/beos/beosd.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- beosd.c   1999/09/07 22:30:59 1.3
  +++ beosd.c   1999/10/22 11:25:41 1.4
  @@ -131,7 +131,7 @@
uid_t uid = atoi(beosd_config.user_name[1]);
   
if ((ent = getpwuid(uid)) == NULL) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
  + ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
 getpwuid: couldn't determine user name from uid %u, 
 you probably need to modify the User directive,
 (unsigned)uid);
  @@ -144,7 +144,7 @@
name = beosd_config.user_name;
   
if (setgid(beosd_config.group_id) == -1) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
  + ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
setgid: unable to set group id to Group %u,
(unsigned)beosd_config.group_id);
return -1;
  @@ -153,7 +153,7 @@
/* Reset `groups' attributes. */
   
if (initgroups(name, beosd_config.group_id) == -1) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
  + ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
initgroups: unable to set groups for User %s 
and Group %u, name, (unsigned)beosd_config.group_id);
return -1;
  @@ -172,7 +172,7 @@
   /* Only try to switch if we're running as root */
   if (!geteuid()  (
setuid(beosd_config.user_id) == -1)) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
  + ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
setuid: unable to change uid);
return -1;
   }
  
  
  
  1.2   +55 -36apache-2.0/src/os/beos/iol_socket.c
  
  Index: iol_socket.c
  ===
  RCS file: /home/cvs/apache-2.0/src/os/beos/iol_socket.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- iol_socket.c  1999/07/12 22:51:14 1.1
  +++ iol_socket.c  1999/10/22 11:25:42 1.2
  @@ -58,6 +58,7 @@
   
   #include httpd.h
   #include ap_iol.h
  +#include iol_socket.h
   
   #include errno.h
   #include sys/types.h
  @@ -72,7 +73,8 @@
   int timeout;
   } iol_socket;
   
  -static int beos_setopt(ap_iol *viol, ap_iol_option opt, const void *value)
  +static ap_status_t beos_setopt(ap_iol *viol, ap_iol_option opt,
  +   const void *value)
   {
   iol_socket *iol = (iol_socket *)viol;
   
  @@ -81,13 +83,12 @@
iol-timeout = *(const int *)value;
break;
   default:
  - errno = EINVAL;
  - return -1;
  + return APR_EINVAL;
   }
  -return 0;
  +return APR_SUCCESS;
   }
   
  -static int beos_getopt(ap_iol *viol, ap_iol_option opt, void *value)
  +static ap_status_t beos_getopt(ap_iol *viol, ap_iol_option opt, void *value)
   {
   iol_socket *iol = (iol_socket *)viol;
   
  @@ -96,16 +97,20 @@
*(int *)value = iol-timeout;
break;
   default:
  - errno = EINVAL;
  - return -1;
  + return APR_EINVAL;
   }
  -return 0;
  +return APR_SUCCESS;
   }
   
  -static int set_nonblock(int fd)
  +static ap_status_t set_nonblock(int fd)
   {
   int on = 1;
  -return setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, on, sizeof(on));
  +int rv;
  +rv = setsockopt(fd, SOL_SOCKET, SO_NONBLOCK, on, sizeof(int));
  +
  +if (rv == 0)
  +return APR_SUCCESS;
  +return errno;
   }
   
   /* the timeout code is a separate routine because it requires
  @@ -115,7 +120,7 @@
   /* this macro expands into the four basic i/o methods */
   
   #define method(name, args, syscall, selread, selwrite)   \
  -static int beos_##name##_timeout args \
  +static ap_status_t beos_##name##_timeout args \
   { \
iol_socket *iol = (iol_socket *)viol; \
fd_set fdset; \
  @@ -130,27 +135,38 @@
rv = select(iol-fd + 1, selread, selwrite, NULL, iol-timeout  0 
? NULL : tv); \
} while (rv == -1  errno == EINTR); \
if (!FD_ISSET(iol-fd, fdset)) { \
  - errno = ETIMEDOUT; \
  - return -1; \
  + return APR_ETIMEDOUT; \
} \
do { \
rv = syscall(iol-fd, arg1, arg2, 0); \
} while (rv == -1  errno == EINTR); \
  - return rv; \
  +if (rv = 0) { \
  +*nbytes = rv; \
  +return APR_SUCCESS; \
  +} \
  + return errno; \
  + \
   } \
\