示例#1
0
文件: main.c 项目: tzuryby/pimd
/* Send signal to running daemon and the show resulting file. */
static void killshow(int signo, char *file)
{
    pid_t pid = daemon_pid();
    char buf[100];

    if (pid > 0) {
	if (file)
	    remove(file);
	kill(pid, signo);
	if (file) {
	    int result;

	    usleep(200);
	    snprintf(buf, sizeof(buf), "cat %s", file);
	    result = system(buf);
	}
    }
}
示例#2
0
文件: main.c 项目: CameronNemo/pimd
/* Send signal to running daemon and the show resulting file. */
static void killshow(int signo, char *file)
{
    pid_t pid = daemon_pid();
    char buf[100];

    if (pid > 0) {
	if (file)
	    remove(file);
	kill(pid, signo);
	if (file) {
	    usleep(200);
	    snprintf(buf, sizeof(buf), "cat %s", file);
	    if (-1 == system(buf)) {
		warnx("Failed listing file %s\n", file);
	    }
	}
    }
}
示例#3
0
文件: main.c 项目: rustyeddy/pimd
/* Send signal to running daemon and the show resulting file. */
static int killshow(int signo, char *file)
{
    pid_t pid = daemon_pid();
    char buf[100];

    if (pid > 0) {
	if (file && -1 == remove(file) && errno != ENOENT)
	    warn("Failed removing %s, may be showing stale information", file);

	kill(pid, signo);
	if (file) {
	    usleep(200);
	    snprintf(buf, sizeof(buf), "cat %s", file);
	    if (-1 == system(buf)) {
		warnx("Failed listing file %s\n", file);
	    }
	}
    }

    return 0;
}