help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: ReturnsZero(): command does not return zero. Is classcreatedwith val


From: Villalovos, John L
Subject: RE: ReturnsZero(): command does not return zero. Is classcreatedwith value of false?
Date: Thu, 29 Apr 2004 09:55:28 -0700

The following patch fixes my issue with the "Wait for child failed"
error.

This also fixes my issue with ReturnsZero.

The POSIX standard says that the return value from wait will be 0 or -1
if a problem occurs.  Otherwise it is the PID of the of the child
process for which status is reported.

rpm calls rpmquery which seems to also call rpmq.  This seems to mess up
cfengine.

Not sure if my code is really thorough.  Maybe we should continue to
listen until the final PID has returned.  Not sure.

John


diff -Naur cfengine-2.1.5.orig/src/misc.c cfengine-2.1.5/src/misc.c
--- cfengine-2.1.5.orig/src/misc.c      2004-04-12 03:48:18.000000000
-0700
+++ cfengine-2.1.5/src/misc.c   2004-04-29 09:44:54.000000000 -0700
@@ -626,7 +626,7 @@
    }
 else                                    /* parent */
    {
-   if (wait(&status) != pid)
+   if (wait(&status) <= 0)
       {
       snprintf(OUTPUT,bufsize,"Wait for child failed\n");
       CfLog(cfinform,OUTPUT,"wait");

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting
Q: What is the most annoying thing on usenet and in e-mail?

Attachment: wait-debug.diff
Description: wait-debug.diff


reply via email to

[Prev in Thread] Current Thread [Next in Thread]