~ubuntu-branches/ubuntu/jaunty/monit/jaunty

« back to all changes in this revision

Viewing changes to protocols/rdate.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-11-13 13:38:47 UTC
  • mfrom: (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20061113133847-s552y2xbe1tiiqgy
Tags: 1:4.8.1-2.1
* Non-maintainer upload.
* monit-lfs.patch: Add LFS support; patch adapted from upstream CVS by
  Michael Mende. (Closes: #395164)
* Build-depend on automake and set some magical cdbs option to enable
  re-automaking, as monit-lfs.patch touches configure.ac.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C), 2000-2005 by the monit project group.
 
2
 * Copyright (C), 2000-2006 by the monit project group.
3
3
 * All Rights Reserved.
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
49
49
 *
50
50
 *  @author Francois Isabelle <Francois.Isabelle@ca.kontron.com>
51
51
 *
52
 
 *  @version \$Id: rdate.c,v 1.7 2005/01/06 20:51:50 martinp Exp $
 
52
 *  @version \$Id: rdate.c,v 1.9 2006/04/27 20:16:03 martinp Exp $
53
53
 *
54
54
 *  @file
55
55
 */
66
66
  ASSERT(s);
67
67
  
68
68
  if(socket_read(s,(char*) &rdatet, sizeof(time_t)) <= 0) {
69
 
    log("RDATE: error receiving data -- %s\n", STRERROR);
 
69
    LogError("RDATE: error receiving data -- %s\n", STRERROR);
70
70
    return FALSE;
71
71
  }
72
72
  
74
74
  rdatet = ntohl(rdatet) - TIME_OFFSET;
75
75
  
76
76
  if((systemt = time(NULL)) == -1) {
77
 
    log("RDATE error: cannot get system time -- %s\n", STRERROR);
 
77
    LogError("RDATE error: cannot get system time -- %s\n", STRERROR);
78
78
    return FALSE;
79
79
  }
80
80
   
84
84
    delta= (systemt-rdatet);
85
85
 
86
86
  if(delta > TIME_TOLERANCE) {
87
 
    log("RDATE error: time does not match system time -- %s\n", STRERROR);
 
87
    LogError("RDATE error: time does not match system time -- %s\n", STRERROR);
88
88
    return FALSE;
89
89
  }
90
90