aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtctimer.c
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2003-02-21 03:00:58 +0000
committervektor <devnull@localhost>2003-02-21 03:00:58 +0000
commiteff651e46477f64e759c71230dbf3caaaad9c2f8 (patch)
tree03a786671bc06be2243ed92c0102f7c20503a15f /src/rtctimer.c
parent99e8f8c47db501b0055692be4171b977eb208e89 (diff)
Bunch of error message cleanups.
Diffstat (limited to 'src/rtctimer.c')
-rw-r--r--src/rtctimer.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rtctimer.c b/src/rtctimer.c
index 4c19223..9a47ca3 100644
--- a/src/rtctimer.c
+++ b/src/rtctimer.c
@@ -45,13 +45,23 @@ rtctimer_t *rtctimer_new( int verbose )
if( !rtctimer ) return 0;
rtctimer->verbose = verbose;
- if( ( rtctimer->rtc_fd = open( "/dev/rtc", O_RDONLY ) ) < 0 ) {
+ if( (( rtctimer->rtc_fd = open( "/dev/rtc", O_RDONLY ) ) < 0) ) {
if( rtctimer->verbose ) {
fprintf( stderr, "rtctimer: Cannot open /dev/rtc: %s\n",
strerror( errno ) );
+ fprintf( stderr, "rtctimer: Trying /dev/misc/rtc just in case...\n" );
+ }
+ if( ( rtctimer->rtc_fd = open( "/dev/misc/rtc", O_RDONLY ) ) < 0 ) {
+ if( rtctimer->verbose ) {
+ fprintf( stderr, "rtctimer: Cannot open /dev/misc/rtc: %s\n",
+ strerror( errno ) );
+ }
+ free( rtctimer );
+ return 0;
+ }
+ if( rtctimer->verbose ) {
+ fprintf( stderr, "rtctimer: Using /dev/misc/rtc instead.\n" );
}
- free( rtctimer );
- return 0;
}
if( fcntl( rtctimer->rtc_fd, F_SETOWN, getpid() ) < 0 ) {

Privacy Policy