FreeBSD Bugzilla – Attachment 208465 Details for
Bug 241373
[UFS] Rename should update the ctime of a multiply-linked destination
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Regression test
rename_ctime_link.c (text/plain), 844 bytes, created by
Alan Somers
on 2019-10-20 15:21:50 UTC
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2019-10-20 15:21:50 UTC
Size:
844 bytes
patch
obsolete
>#include <sys/stat.h> >#include <sys/time.h> >#include <assert.h> >#include <fcntl.h> >#include <stdio.h> >#include <unistd.h> > >int main(int argc, char **argv) { > int src, dst, r; > struct stat sb0, sb1; > > src = open("src", O_CREAT, 0644); > assert(src >= 0); > dst = open("dst", O_CREAT, 0644); > assert(dst >= 0); > r = link("dst", "lnk"); > assert(r == 0); > > r = stat("lnk", &sb0); > assert(r == 0); > > usleep(1000000); > r = rename("src", "dst"); > assert(r == 0); > > r = stat("lnk", &sb1); > assert(r == 0); > > printf("nlink: %lu -> %lu ctime %ld.%ld -> %ld.%ld\n", > sb0.st_nlink, sb1.st_nlink, > sb0.st_ctim.tv_sec, sb0.st_ctim.tv_nsec, > sb1.st_ctim.tv_sec, sb1.st_ctim.tv_nsec); > > if (timespeccmp(&sb0.st_ctim, &sb1.st_ctim, <)) > printf("Everything ok!\n"); > else > printf("Renamed failed to update destination's ctime.\n"); > > return(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 241373
:
208465
|
208490
|
208499