CODE EXAMPLE 1-1System Watchdog Node Management Code Example (Continued)

rc = print_wd_info(argc, argv, optind); (void) picl_shutdown();

return (picl2errno(rc));

}

if (argc != optind) {

(void) picl_shutdown(); usage();

}

if (mflg) {

if ((aflg + tflg) < 1) { /*

*m flag must be associated with atleast

*action or timeout

*/

(void) printf("wdadm: timeout and action values " "are missing\n");

(void) picl_shutdown(); usage();

}

rc = set_wd_params(wd_name, (aflg ? action : NULL), (tflg ? timeout : NULL));

}

if (cflg) {

if (oflg == 0) {

/* operation must be specified along with c option */ (void) printf("wdadm: operation argument is missing\n");

(void) picl_shutdown(); usage();

}

rc = control_wd(cntrl_name, op);

}

(void) picl_shutdown(); return (picl2errno(rc));

}

20 Netra CP2500 Board Programming Guide • March 2007

Page 34
Image 34
Sun Microsystems CP2500 manual Code Example 1-1System Watchdog Node Management Code Example