Commit e5f41cb2 authored by Per Cederqvist's avatar Per Cederqvist

(read_pid_file): Use i_fopen and i_fclose instead of fopen and fclose.

parent f3221e3b
/*
* $Id: pidfile.c,v 1.1 1999/04/17 00:12:13 ceder Exp $
* $Id: pidfile.c,v 1.2 2002/10/31 09:31:12 ceder Exp $
* Copyright (C) 1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,6 +33,7 @@
#include <sys/types.h>
#include "pidfile.h"
#include "eintr.h"
pid_t
read_pid_file(const char *pidfile,
......@@ -43,7 +44,7 @@ read_pid_file(const char *pidfile,
pid_t pid = 0;
int c;
fp = fopen(pidfile, "r");
fp = i_fopen(pidfile, "r");
if (fp == NULL)
{
saved_errno = errno;
......@@ -58,7 +59,7 @@ read_pid_file(const char *pidfile,
ungetc(c, fp);
while ((c = getc(fp)) != EOF && c >= '0' && c <= '9')
pid = 10 * pid + c - '0';
fclose(fp);
i_fclose(fp);
if (pid < 2)
{
fprintf(stderr, "%s: got pid %ld.\n", arg0, (long)pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment