home *** CD-ROM | disk | FTP | other *** search
- /* 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 );
- }
-
-