This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: by function sort_files. 2. Within the sort_files function, several helper functions are used: compare_ctime, compare_mtime, compare_atime 3. After tracing into those three helper functions, I found out that all of them uses another function, timespec_cmp, which is located in timespec.h. 4. It seemed that timespec_cmp's return value becomes incorrect when the time difference is too big (overflow?). To fix it, instead of simply returning the difference, the function now returns -1 when a.tv_sec is less than b.tv_sec, returns 1 when a.tv_sec is greater than b.tv_sec, and if both cases dont meet, return the difference between the a.tv_nsec and b.tv_nsec return (a.tv_sec < b.tv_sec ? -1 : a.tv_sec > b.tv_sec ? 1 : a.tv_nsec - b.tv_nsec);------------------------------------9. Generate the patch file with cvs cvs diff -u timespec.h.orig timespec.h > lab5.patch...
View Full Document
This note was uploaded on 06/02/2009 for the course CS 35L taught by Professor Eggert during the Spring '09 term at UCLA.
- Spring '09