watchdogd.c (200778) | watchdogd.c (201227) |
---|---|
1/* 2 * Copyright (c) 2003-2004 Sean M. Kelly <smkelly@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Software watchdog daemon. 29 */ 30 31#include <sys/types.h> | 1/* 2 * Copyright (c) 2003-2004 Sean M. Kelly <smkelly@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * SUCH DAMAGE. 25 */ 26 27/* 28 * Software watchdog daemon. 29 */ 30 31#include <sys/types.h> |
32__FBSDID("$FreeBSD: head/usr.sbin/watchdogd/watchdogd.c 200778 2009-12-21 15:50:37Z ru $"); | 32__FBSDID("$FreeBSD: head/usr.sbin/watchdogd/watchdogd.c 201227 2009-12-29 22:53:27Z ed $"); |
33 34#include <sys/param.h> 35#include <sys/rtprio.h> 36#include <sys/stat.h> 37#include <sys/time.h> 38#include <sys/watchdog.h> 39 40#include <err.h> --- 103 unchanged lines hidden (view full) --- 144 if (signum == SIGINT || signum == SIGTERM) 145 end_program = 1; 146} 147 148/* 149 * Open the watchdog device. 150 */ 151static int | 33 34#include <sys/param.h> 35#include <sys/rtprio.h> 36#include <sys/stat.h> 37#include <sys/time.h> 38#include <sys/watchdog.h> 39 40#include <err.h> --- 103 unchanged lines hidden (view full) --- 144 if (signum == SIGINT || signum == SIGTERM) 145 end_program = 1; 146} 147 148/* 149 * Open the watchdog device. 150 */ 151static int |
152watchdog_init() | 152watchdog_init(void) |
153{ 154 155 fd = open("/dev/" _PATH_WATCHDOG, O_RDWR); 156 if (fd >= 0) 157 return (0); 158 warn("Could not open watchdog device"); 159 return (-1); 160} --- 54 unchanged lines hidden (view full) --- 215 else 216 return watchdog_patpat(0); 217} 218 219/* 220 * Tell user how to use the program. 221 */ 222static void | 153{ 154 155 fd = open("/dev/" _PATH_WATCHDOG, O_RDWR); 156 if (fd >= 0) 157 return (0); 158 warn("Could not open watchdog device"); 159 return (-1); 160} --- 54 unchanged lines hidden (view full) --- 215 else 216 return watchdog_patpat(0); 217} 218 219/* 220 * Tell user how to use the program. 221 */ 222static void |
223usage() | 223usage(void) |
224{ 225 if (is_daemon) 226 fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n"); 227 else 228 fprintf(stderr, "usage: watchdog [-d] [-t timeout]\n"); 229 exit(EX_USAGE); 230} 231 --- 64 unchanged lines hidden --- | 224{ 225 if (is_daemon) 226 fprintf(stderr, "usage: watchdogd [-d] [-e cmd] [-I file] [-s sleep] [-t timeout]\n"); 227 else 228 fprintf(stderr, "usage: watchdog [-d] [-t timeout]\n"); 229 exit(EX_USAGE); 230} 231 --- 64 unchanged lines hidden --- |