PWM and HAM?

QNX 6.3.0 SP3

There’s no problem to use HAM (High Availability Manager) for “normal” processes. I create entity (ham_attach()), condition (ham_condition()) and action to execute when condition is met for the entity (ham_action*()).

However, when I do this for PWM (Photon Window Manager), it simply doesn’t work. There’s simple code:

#include <stdlib.h>
#include <stdio.h>
#include <ha/ham.h>

int main(int argc, char *argv[])
{
ham_entity_t* ehdl;
ham_condition_t* chdl;
ham_action_t* ahdl;

ham_connect(0); //Connect to HAM.

if(!(ehdl = ham_attach("pwm",0,0,"/usr/photon/bin/pwm",0)))
perror(NULL); //Create entity for PWM. If error, print it.

if(!(chdl = ham_condition(ehdl,CONDDEATH,"pwm_death",HREARMAFTERRESTART)))
perror(NULL); //Create condition for above entity. Condition is met when PWM dies. Rearm condition after restart. If error, print it.

if(!(ahdl = ham_condition_restart(chdl,"pwm_restart","/usr/photon/bin/pwm",HREARMAFTERRESTART)))
perror(NULL); //Restart PWM, when above condition is met. Rearm action after restart. If error, print it.

return EXIT_SUCCESS;
}

(compile with -lham option)

So, first I run HAM (“ham” command in a console). Then I kill PWM and run my program (above code). PWM starts, everything’s ok, I can see entity for PWM in /proc/ham directory. My program doesn’t print any errors. But when I kill PWM (“slay pwm” for example) nothing happens, PWM doesn’t restart and in /proc/ham directory the entity for PWM still exists(!) When I replace “pwm” with “phcalc” for example in the above code, everything works fine. Calculator restarts after closing it. I tried different flags for ham_attach(), ham_condition() and ham_action*() with no results.

Why HAM doesn’t work for PWM process?