mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Change commenting style
This commit is contained in:
parent
cfd1eac70c
commit
cebc9b62f2
22 changed files with 1044 additions and 603 deletions
|
|
@ -24,9 +24,11 @@ void state_touch(struct snapraid_state* state)
|
|||
for (j = disk->filelist; j != 0; j = j->next) {
|
||||
struct snapraid_file* file = j->data;
|
||||
|
||||
/* if the file has a zero nanosecond timestamp */
|
||||
/* note that symbolic links are not in the file list */
|
||||
/* and then are not processed */
|
||||
/*
|
||||
* If the file has a zero nanosecond timestamp
|
||||
* note that symbolic links are not in the file list
|
||||
* and then are not processed
|
||||
*/
|
||||
if (file->mtime_nsec == 0) {
|
||||
char path[PATH_MAX];
|
||||
struct stat st;
|
||||
|
|
@ -52,8 +54,10 @@ void state_touch(struct snapraid_state* state)
|
|||
nsec = nano % 1000000000;
|
||||
} while (nsec == 0);
|
||||
|
||||
/* O_BINARY: open as binary file (Windows only) */
|
||||
/* O_NOFOLLOW: do not follow links to ensure to open the real file */
|
||||
/*
|
||||
* O_BINARY: open as binary file (Windows only)
|
||||
* O_NOFOLLOW: do not follow links to ensure to open the real file
|
||||
*/
|
||||
flags = O_BINARY | O_NOFOLLOW;
|
||||
#ifdef _WIN32
|
||||
/* in Windows we must have write access at the file */
|
||||
|
|
@ -90,8 +94,10 @@ void state_touch(struct snapraid_state* state)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* get the present timestamp, that may be different than the one */
|
||||
/* in the content file */
|
||||
/*
|
||||
* Get the present timestamp, that may be different than the one
|
||||
* in the content file
|
||||
*/
|
||||
ret = fstat(f, &st);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -111,9 +117,11 @@ void state_touch(struct snapraid_state* state)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* uses fstat again to get the present timestamp */
|
||||
/* this is needed because the value read */
|
||||
/* may be different than the written one */
|
||||
/*
|
||||
* Uses fstat again to get the present timestamp
|
||||
* this is needed because the value read
|
||||
* may be different than the written one
|
||||
*/
|
||||
ret = fstat(f, &st);
|
||||
if (ret == -1) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -132,10 +140,12 @@ void state_touch(struct snapraid_state* state)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* set the same nanosecond value in the content file */
|
||||
/* note that if the seconds value is already matching */
|
||||
/* the file won't be synced because the content file will */
|
||||
/* contain the new updated timestamp */
|
||||
/*
|
||||
* Set the same nanosecond value in the content file
|
||||
* note that if the seconds value is already matching
|
||||
* the file won't be synced because the content file will
|
||||
* contain the new updated timestamp
|
||||
*/
|
||||
file->mtime_nsec = STAT_NSEC(&st);
|
||||
|
||||
/* state changed, we need to update it */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue