diff options
author | Jan Kara <jack@suse.cz> | 2015-01-05 15:44:18 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2015-01-05 17:12:56 +0100 |
commit | 094306bbfdbaacf2b9920b6dc44a6ee155fea1c5 (patch) | |
tree | 58cfc19395a7ba71388ded03bd7b814860802f94 /common.c | |
parent | 33160239630e668413bcb915490f604f2870309a (diff) |
edquota: Do not unnecessarily overwrite limits/times
When user doesn't edit the file with limits / grace times, there is no
need to overwrite the values in quota files. Maybe admin really wanted
to cancel the operation by not writing the file.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -125,3 +125,16 @@ void version(void) printf(_("Compiled with:%s\n"), COMPILE_OPTS); printf(_("Bugs to %s\n"), PACKAGE_BUGREPORT); } + +int timespec_cmp(struct timespec *a, struct timespec *b) +{ + if (a->tv_sec < b->tv_sec) + return -1; + if (a->tv_sec > b->tv_sec) + return 1; + if (a->tv_nsec < b->tv_nsec) + return -1; + if (a->tv_nsec > b->tv_nsec) + return 1; + return 0; +} |