/[monit]/monit/util.c
ViewVC logotype

Diff of /monit/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.175 by martinp, Wed Nov 30 09:17:49 2005 UTC revision 1.176 by hauk, Sat Dec 3 13:39:00 2005 UTC
# Line 1107  pid_t Util_getPid(char *pidfile) { Line 1107  pid_t Util_getPid(char *pidfile) {
1107    ASSERT(pidfile);    ASSERT(pidfile);
1108    
1109    if(! File_exist(pidfile)) {    if(! File_exist(pidfile)) {
1110      log("%s: pidfile '%s' does not exist\n",prog, pidfile);      DEBUG("%s: pidfile '%s' does not exist\n",prog, pidfile);
1111      return(FALSE);      return FALSE;
1112    }    }
1113    if(! File_isFile(pidfile)) {    if(! File_isFile(pidfile)) {
1114      log("%s: pidfile '%s' is not a regular file\n",prog, pidfile);      log("%s: pidfile '%s' is not a regular file\n",prog, pidfile);
1115      return(FALSE);      return FALSE;
1116    }    }
1117    if((file= fopen(pidfile,"r")) == (FILE *)NULL) {    if((file= fopen(pidfile,"r")) == (FILE *)NULL) {
1118      log("%s: Error opening the pidfile '%s' -- %s\n",      log("%s: Error opening the pidfile '%s' -- %s\n",
1119          prog, pidfile, STRERROR);          prog, pidfile, STRERROR);
1120      return(FALSE);      return FALSE ;
1121    }    }
1122    fscanf(file, "%d", &pid);    fscanf(file, "%d", &pid);
1123    fclose(file);    fclose(file);

Legend:
Removed from v.1.175  
changed lines
  Added in v.1.176

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26