home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 August - Disc 3
/
chip_20018103_hu.iso
/
amiga
/
chiputil
/
operclock.lha
/
operationalclock.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-06-17
|
738b
|
40 lines
/* Neil Williams, neil@tkgbbs.freeserve.co.uk
* Fidonet 2:442/107
* Written 17th June 2001 for an A4000D whose
* clock doesn't tick on power up even after
* replacing the battery, but works fine after
* a reboot.
*/
#define __USE_SYSBASE
#include <stdio.h>
#include <time.h>
#include <proto/exec.h>
#include <exec/exec.h>
#include <proto/dos.h>
#include <dos/dos.h>
int main( int *argc, char *argv[] )
{
time_t timet1, timet2;
timet1 = time( NULL );
/* Wait two seconds, so we are sure to pass at least one time unit (1s)
*/
Delay( 100 );
timet2 = time( NULL );
if( timet1 == timet2 )
{
Printf( "System time is not running, rebooting system." );
ColdReboot();
}
return( 0 );
}