Pojar George - 2012-02-05

You're not checking the return value of read, which is a bug just waiting to happen.

ssize_t r = read(rtctimer->rtc_fd, &rtc_data, sizeof( rtc_data ) );
if (r == -1) {
// deal with failed read
} else if (r != sizeof(rtc_data)) {
// you didn't read as much as you wanted to

If you don't check what read returns, chances are very high that your program will fail unexpectedly if a read error does occur, and it will be impossible to debug. (The second case might not apply in this specific example, or for some pipe reads.)

Always check the return value of library calls, especially I/O ones since they do fail in normal circumstances.