You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Sander Striker <st...@apache.org> on 2001/09/20 00:37:55 UTC

FW: Updating svn.collab.net

[forwarded thread from dev@subversion.tigris.org]

-----Original Message-----
From: Kevin Pilch-Bisson [mailto:kevin@pilch-bisson.net]
Sent: 19 September 2001 21:46
To: cmpilato@collab.net
Cc: Greg Stein; Sander Striker; dev@subversion.tigris.org
Subject: Re: Updating svn.collab.net


On Wed, Sep 19, 2001 at 01:47:32PM -0500, cmpilato@collab.net wrote:
> Greg Stein <gs...@lyra.org> writes:
>
> > IMO, it should be a repository-defined attribute, rather than a
client-side
> > issue. Of course, clients may also want to enforce it, but that is
beside
> > the point.
>
> Couldn't this be repository-side enforced with a pre-commit hook that
> makes sure that there's not an empty log message?
>
Well, not at present, since commits are going through regardless of the
value they return.  There doesn't seem to be a way to get the process'
return value from apr. :(
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----Original Message-----
From: Bill Tutt [mailto:billtut@microsoft.com]
Sent: 19 September 2001 22:31
To: Kevin Pilch-Bisson; cmpilato@collab.net
Cc: Greg Stein; Sander Striker; dev@subversion.tigris.org
Subject: RE: Re: Updating svn.collab.net


[... APR not returning proc exit code]

Which is really odd, since all of the APR supported OS's with possibly
the exception of BeOS should support the concept... Win32 and Unix
certainly do.

Bill

"Though we are not now that strength that in old days moved Earth and
Heaven, that which we are we are; One equal temper of heroic hearts made
weak by time and fate but strong in will to strive, to seek, to find,
and not to yeild." -- Tennyson

-----Original Message-----
From: Kevin Pilch-Bisson [mailto:kevin@pilch-bisson.net]
Sent: 19 September 2001 22:27
To: Bill Tutt
Cc: cmpilato@collab.net; Greg Stein; Sander Striker;
dev@subversion.tigris.org
Subject: Re: Re: Updating svn.collab.net


On Wed, Sep 19, 2001 at 01:30:55PM -0700, Bill Tutt wrote:
> [... APR not returning proc exit code]
>
> Which is really odd, since all of the APR supported OS's with possibly
> the exception of BeOS should support the concept... Win32 and Unix
> certainly do.

Well you can get it from apr_proc_wait_all_procs, just not from
apr_proc_wait.
Maybe a patch is in order?
>
> Bill
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson                    http://www.pilch-bisson.net
     "Historically speaking, the presences of wheels in Unix
     has never precluded their reinvention." - Larry Wall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Re: [PATCH] Add return value to apr_proc_wait

Posted by Greg Stein <gs...@lyra.org>.
On Wed, Sep 19, 2001 at 11:14:00PM -0700, Justin Erenkrantz wrote:
>...
> How would this patch work?  This seems like a reasonable change.
> 
> Win32 doesn't implement wait_all from what I can tell, so I'm not
> sure how to get the return value.  OtherBill or Ryan can probably
> figure this out.  -- justin

We already have a patch from Bill Tutt for Win32 that changes the signature
in the same way as yours. With your patch and his, we should be pretty well
set.

Applying both momentarily...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

[PATCH] Add return value to apr_proc_wait was Re: FW: Updating svn.collab.net

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Thu, Sep 20, 2001 at 12:37:55AM +0200, Sander Striker wrote:
> [forwarded thread from dev@subversion.tigris.org]
> 
> -----Original Message-----
> From: Kevin Pilch-Bisson [mailto:kevin@pilch-bisson.net]
> Sent: 19 September 2001 21:46
> To: cmpilato@collab.net
> Cc: Greg Stein; Sander Striker; dev@subversion.tigris.org
> Subject: Re: Updating svn.collab.net
> 
> 
> On Wed, Sep 19, 2001 at 01:47:32PM -0500, cmpilato@collab.net wrote:
> > Greg Stein <gs...@lyra.org> writes:
> >
> > > IMO, it should be a repository-defined attribute, rather than a
> client-side
> > > issue. Of course, clients may also want to enforce it, but that is
> beside
> > > the point.
> >
> > Couldn't this be repository-side enforced with a pre-commit hook that
> > makes sure that there's not an empty log message?
> >
> Well, not at present, since commits are going through regardless of the
> value they return.  There doesn't seem to be a way to get the process'
> return value from apr. :(

How would this patch work?  This seems like a reasonable change.

Win32 doesn't implement wait_all from what I can tell, so I'm not
sure how to get the return value.  OtherBill or Ryan can probably
figure this out.  -- justin

Index: include/apr_thread_proc.h
===================================================================
RCS file: /home/cvs/apr/include/apr_thread_proc.h,v
retrieving revision 1.74
diff -u -r1.74 apr_thread_proc.h
--- include/apr_thread_proc.h	2001/09/09 06:03:05	1.74
+++ include/apr_thread_proc.h	2001/09/20 06:02:58
@@ -481,6 +481,9 @@
 /**
  * Wait for a child process to die
  * @param proc The process handle that corresponds to the desired child process 
+ * @param status The returned exit status of the child, if a child process dies
+ *               On platforms that don't support obtaining this information, 
+ *               the status parameter will be returned as APR_ENOTIMPL.
  * @param waithow How should we wait.  One of:
  * <PRE>
  *            APR_WAIT   -- block until the child process dies.
@@ -494,6 +497,7 @@
  * </PRE>
  */
 APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, 
+                                        apr_wait_t *status,
                                         apr_wait_how_e waithow);
 
 /**
Index: threadproc/unix/proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/unix/proc.c,v
retrieving revision 1.47
diff -u -r1.47 proc.c
--- threadproc/unix/proc.c	2001/08/10 21:04:48	1.47
+++ threadproc/unix/proc.c	2001/09/20 06:02:58
@@ -380,23 +380,24 @@
 } 
 
 APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, 
+                                        apr_wait_t *status,
                                         apr_wait_how_e waithow)
 {
-    pid_t status;
+    pid_t pstatus;
 
     if (waithow == APR_WAIT) {
-        if ((status = waitpid(proc->pid, NULL, WUNTRACED)) > 0) {
+        if ((pstatus = waitpid(proc->pid, status, WUNTRACED)) > 0) {
             return APR_CHILD_DONE;
         }
-        else if (status == 0) {
+        else if (pstatus == 0) {
             return APR_CHILD_NOTDONE;
         }
         return errno;
     }
-    if ((status = waitpid(proc->pid, NULL, WUNTRACED | WNOHANG)) > 0) {
+    if ((pstatus = waitpid(proc->pid, status, WUNTRACED | WNOHANG)) > 0) {
         return APR_CHILD_DONE;
     }
-    else if (status == 0) {
+    else if (pstatus == 0) {
         return APR_CHILD_NOTDONE;
     }
     return errno;
Index: threadproc/beos/proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/beos/proc.c,v
retrieving revision 1.39
diff -u -r1.39 proc.c
--- threadproc/beos/proc.c	2001/09/11 13:33:39	1.39
+++ threadproc/beos/proc.c	2001/09/20 06:02:58
@@ -299,16 +299,17 @@
 } 
 
 APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, 
+                                        apr_wait_t *status,
                                         apr_wait_how_e wait)
 {
-    status_t exitval, rv;
+    status_t rv;
 
     if (!proc)
         return APR_ENOPROC;
     /* when we run processes we are actually running threads, so here
        we'll wait on the thread dying... */
     if (wait == APR_WAIT) {
-        if ((rv = wait_for_thread(proc->pid, &exitval)) == B_OK) {
+        if ((rv = wait_for_thread(proc->pid, status)) == B_OK) {
             return APR_CHILD_DONE;
         }
         return rv;
Index: threadproc/netware/proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/netware/proc.c,v
retrieving revision 1.1
diff -u -r1.1 proc.c
--- threadproc/netware/proc.c	2001/08/02 20:29:14	1.1
+++ threadproc/netware/proc.c	2001/09/20 06:02:58
@@ -393,6 +393,7 @@
 } 
 
 apr_status_t apr_proc_wait(apr_proc_t *proc, 
+                           apr_wait_t *status,
                            apr_wait_how_e waithow)
 {
 #if 0
Index: threadproc/os2/proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/proc.c,v
retrieving revision 1.44
diff -u -r1.44 proc.c
--- threadproc/os2/proc.c	2001/08/23 16:42:27	1.44
+++ threadproc/os2/proc.c	2001/09/20 06:02:58
@@ -527,6 +527,7 @@
 
 
 APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
+                                        apr_wait_t *status,
                                         apr_wait_how_e wait)
 {
     RESULTCODES codes;
@@ -538,6 +539,8 @@
 
     rc = DosWaitChild(DCWA_PROCESS, wait == APR_WAIT ? DCWW_WAIT : DCWW_NOWAIT, &codes, &pid, proc->pid);
 
+    if (status)
+        *status = codes.codeResult;
     if (rc == 0) {
         return APR_CHILD_DONE;
     } else if (rc == ERROR_CHILD_NOT_COMPLETE) {
Index: threadproc/win32/proc.c
===================================================================
RCS file: /home/cvs/apr/threadproc/win32/proc.c,v
retrieving revision 1.55
diff -u -r1.55 proc.c
--- threadproc/win32/proc.c	2001/09/17 21:24:29	1.55
+++ threadproc/win32/proc.c	2001/09/20 06:02:58
@@ -540,11 +540,15 @@
     return APR_SUCCESS;
 }
 
-APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, apr_wait_how_e wait)
+APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
+                                        apr_wait_t *status,
+                                        apr_wait_how_e wait)
 {
     DWORD stat;
     if (!proc)
         return APR_ENOPROC;
+    if (status)
+        *status = APR_ENOTIMPL;
     if (wait == APR_WAIT) {
         if ((stat = WaitForSingleObject(proc->hproc, 
                                         INFINITE)) == WAIT_OBJECT_0) {